this my task.. hope can help..

hi all :).. this my task.. hope can help.. already try again and again can't find the solution... :(
how to make a c++ program using while loop to output this:

5 4 3 2 1
4 3 2 1
3 2 1
2 1
1

thank you :)
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
using namespace std;

int main(){
int i=5;
int j;
while(i>0){
       j=i;
    while(j>0){
        cout<<j;
        j=j-1;
    }
    i=i-1;
    cout<<endl;

}

return 0;
}
thank you so much... :)
Topic archived. No new replies allowed.