Write a program to display the following pyramid structure using do while loop. 55555 4444 333 22 1

 Write a program to display the following pyramid structure using do while loop. 

55555 
4444 
333 
22 
  # include <iostream>
using namespace std;
int main(){

       int a = 5;
       do{

              int b = 1;
              do{

                     cout << a;
                     b++;
              } while (b <= a);
              cout << endl;
              a--;
       } while (a >= 0);


       system("pause");
       return 0;
}

Comments