Question: this is in c++ #include using namespace std; int main() { int rows; cout < < Enter how many stars you want in the first

this is in c++

#include using namespace std;

int main() { int rows; cout << "Enter how many stars you want in the first row "; cin >> rows; for(int x= rows; x>=1; --x) { for(int a=1;x<=a;++a) { cout<<"*"; } cout << endl; } return 0; }

why is it an infinite loop im trying for this to happen

Using a nested for loop write commented code that prompts the user enter a positive number and then uses that number to create rows of decreasing asterixes all the way to 1

for example if the user enters 8 you output

********

*******

******

*****

****

***

**

*

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!