Code : Interesting Alphabets
Code : Interesting Alphabets
Send Feedback
Code : Interesting Alphabets
E
DE
CDE
BCDE
ABCDE
N (Total no. of rows)
Pattern in N lines
0 <= N <= 26
8
H
GH
FGH
EFGH
DEFGH
CDEFGH
BCDEFGH
ABCDEFGH
7
G
FG
EFG
DEFG
CDEFG
BCDEFG
ABCDEFG
#include<iostream>using namespace std;
int main() { int n; cin>>n; int row=1;
while(n>=row){ int col=1; char startchar='A'+n-row; while(row>=col){ char ch=startchar+col-1; cout<<ch; col++; } cout<<endl; row++; }
}
Comments
Post a Comment