Switch to full style
For C/C++ coders discussions and solutions
Post a reply

do while loop and for loop C++ example help.

Sat Apr 09, 2011 1:31 am

Code:

int x
=5

do{

      print(
"%d\n",x);
      
x--;
}while(
x>=1)
 





Code:

int m
=0i;
for(
i=1;i<=7;i+=3){
     
m=m+i;
     print(
"m=%d\n",m);





Re: do while loop and for loop C++ example help.

Sat Apr 09, 2011 4:31 pm

For code snippet :do-while loop prints :
5
4
3
2
1

Second example prints :
1
4
11

Re: do while loop and for loop C++ example help.

Tue Sep 13, 2011 2:49 am

lol Shouldn't give him the answers looks like homework to me should give him tips. Pretty close to the same questions i had on my last weeks programming homework.

Post a reply
  Related Posts  to : do while loop and for loop C++ example help.
 C++ While loop     -  
 Do while loop     -  
 While loop     -  
 Breaking a Loop     -  
 PIC Assembly For Loop Example     -  
 I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER     -  
 Using include() Within a Loop     -  
 Why will my loop does not work     -  
 Need help with code for a while loop program     -  
 Counting Backwards Loop     -