+ 1

Print the pattern

1 3 5 5 7 9 7 9 1 3 9 1 3 5 7

9th Apr 2017, 4:23 AM
Vivek
Vivek - avatar
2 ответов
9th Apr 2017, 5:33 AM
Sachin Artani
Sachin Artani - avatar
+ 3
k=1; for(i=1;i<=5;i++) { for(j=1;j<=i; j++) { if(k>9) k=1; cout<<k<<" "; k+=2; } cout<<endl; }
10th Apr 2017, 12:33 PM
Harshitha P N