Try This
Code:#include <iostream> #define MAX 5 int main() { for ( int i = 1; i <= MAX; ++i) { for(int k=0;k<MAX-i;k++) { std::cout<<" "; } for ( int j = 1; j <= i; ++j ) std::cout << "**"; std::cout << "\n"; } return 0; }
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 5 of 5
Thread: Nested Loops helpThreaded View
|
Click Here to Expand Forum to Full Width |