WAP C++ to left side star pattern 2
*****
****
***
**
*
Code:-
#include <iostream>
using namespace std;
int main()
{
int r = 5;
//The first loop creates the rows
for (int i = 0; i < r; i++) {
// loop for print * (star)
for (int j = 0; j < (r - i) ; j++) {
cout<<"*";
}
cout<<endl;
}
return 0;
}