Question
/* ----------------------------------------------------------- ----------------------------------------------------------- The program below prompts the user to enter a value for x that is below 10. It then displays the character 'A'
/* ----------------------------------------------------------- -----------------------------------------------------------
The program below prompts the user to enter a value for x that is below 10. It then displays the character 'A' for 10-x times using a do-while loop.
However, the program contains some error(s). You have to correct the error(s), so that it will behave like in the sample runs below.
You have to maintain using the do-while loop structure.
=============================== Sample Run: Enter x (below 10): 6 AAAA =============================== Sample Run: Enter x (below 10): 1 AAAAAAAAA =============================== -----------------------------------------------------------*/
#include
int main() { int x = 0;
cout << "Enter x (below 10): "; cin >> x;
// Only make changes after this line: // You have to maintain using the do-while loop structure. do { cout << "A"; } while(x < 10)
cout << endl;
return 0;
}
Solve the program in C++ language
Thankyou in advance
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started