+ 2

Hello I need to print this figure 1 13 135 1357 how can do this question in for loop?

1 13 135 1357 answer me

25th Mar 2017, 9:22 AM
Bts...
Bts... - avatar
9 Respostas
+ 14
for(int i=1;i<m;i=i+2) { for(int j=1;j<=i;j++) { if(j%2!=0) cout<<j<<" "; } cout<<endl; }
25th Mar 2017, 10:09 AM
Sachin Artani
Sachin Artani - avatar
+ 7
here it is for(i=1;i<4 ;i++) { for(j=1;j<=i;j++) { cout<<2*j-1; } cout<<endl; } hope this helps.
25th Mar 2017, 10:09 AM
Rishabh Agrawal
Rishabh Agrawal - avatar
+ 4
for(int i= 0;i<n;i++) { for(int j=0;j<i;j++) cout<<(2*j-1)<<"\t"; cout<<endl; } it would work.. 😉
25th Mar 2017, 10:05 AM
Dhairya Agarwal
Dhairya Agarwal - avatar
17th Feb 2019, 6:51 AM
Sachin Artani
Sachin Artani - avatar
+ 2
for(int i=0;i<4;i++) { for(int j=0;j<=i;j++) cout<<2*j+1<<"\t"; cout<<endl; }
25th Mar 2017, 10:23 AM
prashant kumar
prashant kumar - avatar
+ 2
thank you my friends 🤗🙂
25th Mar 2017, 11:52 AM
Bts...
Bts... - avatar
+ 1
Write python script to print the following 1 13 135 1357
5th Dec 2018, 1:01 PM
Charan Chowdary
Charan Chowdary - avatar
+ 1
Hello friends I need to write program of Pascal triangle
16th Feb 2019, 5:57 PM
vikas gupta
+ 1
Can u help me???
16th Feb 2019, 5:58 PM
vikas gupta