For Loop
no. not at all. Actually I want to take below output.
Last edited on
Ok. This is right:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <iostream>
using namespace std;
int main()
{
for (int x=0; x < 5; x++)
{
for (int y=0; y <= (5-x) ; y++)
{
cout << 'x';
}
cout << "\n";
}
return 0;
}
|
Thats worked. Thanks.
Topic archived. No new replies allowed.