Answer to Question #266509 in C++ for Glady_07

Question #266509

Using a nested for loop, create a program that will display the following:



55555


4444


333


22


1

1
Expert's answer
2021-11-15T17:23:30-0500

Source code



#include <iostream>


using namespace std;


int main()
{
    int n=5;
    for(int i=5;i>=1;i--){
        for(int j=1;j<=i;j++){
            cout<<i;
            
        }
        cout<<endl;
    }


    return 0;
}


Output


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS