Skip to main content
Write a program to display the following pyramid structure
Write a program to display the following pyramid structure using while loop.
1
22
333
4444
55555
#include <iostream>
using namespace std;
int main(){
int a = 1;
while (a<=5)
{
int b = 1;
while (b<a){
cout
<< a;
b++;
}
cout
<< a << endl;
a++;
}
system("pause");
return 0;
}
Comments
Post a Comment