Question subject: do while loop and for loop C++ example help.
Posted: Sat Apr 09, 2011 1:31 am
Joined: Fri Apr 08, 2011 2:20 am Posts: 6 Has thanked: 5 time Have thanks: 0 time
Code:
int x=5
do{
print("%d\n",x); x--; }while(x>=1)
Code:
int m=0, i; for(i=1;i<=7;i+=3){ m=m+i; print("m=%d\n",m);
}
msi_333
Question subject: Re: do while loop and for loop C++ example help.
Posted: Sat Apr 09, 2011 4:31 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2272 Location: Earth Has thanked: 39 time Have thanks: 61 time
For code snippet :do-while loop prints : 5 4 3 2 1
Second example prints : 1 4 11
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
For this message the author msi_333 has received gratitude : sakorian
Atropos
Question subject: Re: do while loop and for loop C++ example help.
Posted: Tue Sep 13, 2011 2:49 am
Joined: Tue Sep 13, 2011 2:39 am Posts: 2 Has thanked: 0 time Have thanks: 0 time
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.