Code: Character Pattern
Code: Character Pattern
Send Feedback
Code: Character Pattern
A
BC
CDE
DEFG
Integer N (Total no. of rows)
Pattern in N lines
0 <= N <= 13
#include<iostream>using namespace std;
int main(){ int n; cin>>n; int row=1;
while(n>=row){ int col=1; char startchar='A'+row-1; while(row>=col){ char ch=startchar+col-1; cout<<ch; col++; } cout<<endl; row++; }
/* Read input as specified in the question. * Print output as specified in the question. */ }
Comments
Post a Comment