Code: Triangular Star Pattern
Code: Triangular Star Pattern
Send Feedback
Code: Triangular Star Pattern
*
**
***
****
Integer N (Total no. of rows)
Pattern in N lines
0 <= N <= 50
5
*
**
***
****
*****
6
*
**
***
****
*****
******
#include<iostream>using namespace std;
int main(){ int n; cin>>n; int row=1; while(n>=row){ int col=1; while(row>=col){ cout<<"*"; col++; } cout<<endl; row++; }
/* Read input as specified in the question. * Print output as specified in the question. */ }
Comments
Post a Comment