- C Mr Jamal Intends To Write A C Program Where The Numbers 1 2 3 4 And 5 Will Be Printed Three Times Respectivel 1 (33.91 KiB) Viewed 38 times
(c) Mr. Jamal intends to write a C++ program where the numbers 1, 2, 3, 4 and 5 will be printed three times, respectivel
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
(c) Mr. Jamal intends to write a C++ program where the numbers 1, 2, 3, 4 and 5 will be printed three times, respectivel
(c) Mr. Jamal intends to write a C++ program where the numbers 1, 2, 3, 4 and 5 will be printed three times, respectively. However, he found some difficulties in executing his program. Detect and correct the error(s) in the C++ program given in Figure 1 so that Mr. Jamal can produce the desired output, as shown in Figure 2. #include using namespace stg; int main() [ int a = 1; do { SSS5AA WWW NNZLLE return 0; ] int b= 1; do { cout << a << "\n"; b++; } while (b 3); a++; while (a <5) Figure 1: Mr. Jamal's C++ program. Figure 2: Sample run of the program.