A C++ program to print the below pattern
*****
****
***
**
*
Code
#include <iostream>
using namespace std;
int main() {
for(int i=5;i>0;i--){ //1st loop holds count
for(int j=1;j<=i;j++){ //2nd loop print i stars
cout<<"*";
}
cout<<endl;
}
return 0;
}
Output
*****
****
***
**
*
0 Comments