Code: Alpha Pattern...
Code: Alpha Pattern
Send Feedback
Code: Alpha Pattern
A
BB
CCC
Integer N (Total no. of rows)
Pattern in N lines
0 <= N <= 26
7
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
6
A
BB
CCC
DDDD
EEEEE
FFFFFF
#include<iostream>using namespace std;
int main(){ int row=1; int n; cin>>n; char ch='A'; while(n>=row){ int col=1; // char ch='A'+row-1; // it is also carrect while(row>=col){ cout<<ch; col++; } cout<<endl; row++; ch++; } /* Read input as specified in the question. * Print output as specified in the question. */ }
Comments
Post a Comment