Using a nested for loop, create a program that will display the following:
55555
4444
333
22
1
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?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments