Any looping would do :))

You pros are once newbies like us. Hoped you might take a little time sharing your expertise. Got freaked out when our teacher gave us this activity, where she haven't taught this to us yet. So this is the activity (LOOPING) :

Write a program that accepts a positive integer. The program should be the same from the given output. Use do while to allow the user to continue or not.

OUTPUT must be:

n = 5
0
1==0
2==1==0
3==2==1==0
4==3==2==1==0
5==4==3==2==1==0

if n = 6
0
1==0
2==1==0
3==2==1==0
4==3==2==1==0
5==4==3==2==1==0
6==5==4==3==2==1==0
This is not really to hard to do, I recommend you check out this page for beginner's tips:

http://www.cplusplus.com/doc/tutorial/control/

It has the do while loop explained in there. Just a hint on the first example to get you started though
1
2
3
4
do {
   //fill in with your couts and arithmetic for n

} while ( n < 6 )


Oh, and maybe you should post this in beginner's forum next time. Questions like these usually gets answered faster there.
Last edited on
That helped a little sire but thanks. :))
Topic archived. No new replies allowed.