Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions