challenge to all coders | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

challenge to all coders

display 1 ** 2 *** 3 **** 4

6th Nov 2017, 1:56 PM
B.ARAVIND KUMAR
B.ARAVIND KUMAR - avatar
4 Answers
+ 14
Wait. I will make
7th Nov 2017, 10:37 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
7th Nov 2017, 2:03 PM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 4
Mr. B.ARAVIND KUMAR will you please post the answer for your question? I almost reached it. #include <iostream> using namespace std; int main() { int i,j; int n=6; int count; int counts; counts=1; count=1; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { if((j==count)) { cout<<j; count++; } else cout<<" "; } cout<<endl; for(j=0;j<=i;j++) { if(i!=n) cout<<"*"; counts++; } cout<<endl; for(j=1;j<counts-2;j++) { cout<<" "; } } return 0; }
7th Nov 2017, 2:08 PM
Muthumani V
Muthumani V - avatar
0
http://code.sololearn.com/cL0ZS5zVrkri/ Will go from the other side if screen too small
7th Nov 2017, 6:22 PM
Max S