Overclock.net banner

HELP! I really dont know this...

361 Views 4 Replies 4 Participants Last post by  woodpigeon4
how can i create a c++ program that accept a number and display a right triangle based on its values

Quote:
Enter A Number: 5

Quote:
1
22
333
4444
55555
1 - 5 of 5 Posts
Code:
Code:
int num;
cout << "Enter a number: ";
cin >> num;

for (int y=1;y<=num;y++)
{
    for (int x=1;x<=num;x++)
    {
        cout << x;
    }
    cout << endl;
}
There you go!
See less See more
Quote:


Originally Posted by Kuntz
View Post

Rep+ me!


... fairly certain that's against the ToS.
See less See more
Quote:


Originally Posted by tindolos
View Post

... fairly certain that's against the ToS.

Yes, it is. I'm sure he would have got rep anyway.
See less See more
1 - 5 of 5 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top