Identify the error/s and correct the ff program statements below. How many times will each of the following loops executes. What is the output? (no need to send screencap or listing the errors) 1. x=3 y =21; while (x < y) x= x + 7; cout << “ ” < y+x << endl; 2. int i=2, value =3; for(; i; < 5;) value = value * (i+1 + i; i++ cout<< “value =” << value << endl; 3. X=5 y=45; do x= x + 5 while (x<=y); cout<< x << “ ” y << endl; part 2. Create a program using any loop that will provide the ff output. * *** ***** ******* *********
Identify the error/s and correct the ff program statements below. How many times will each of the following loops executes. What is the output? (no need to send screencap or listing the errors) 1. x=3 y =21; while (x < y) x= x + 7; cout << “ ” < y+x << endl; 2. int i=2, value =3; for(; i; < 5;) value = value * (i+1 + i; i++ cout<< “value =” << value << endl; 3. X=5 y=45; do x= x + 5 while (x<=y); cout<< x << “ ” y << endl; part 2. Create a program using any loop that will provide the ff output. * *** ***** ******* *********
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Identify the error/s and correct the ff
1. x=3 y =21;
while (x < y)
x= x + 7;
cout << “ ” < y+x << endl;
2. int i=2, value =3;
for(; i; < 5;)
value = value * (i+1 + i; i++
cout<< “value =” << value << endl;
3. X=5 y=45;
do
x= x + 5
while (x<=y);
cout<< x << “ ” y << endl;
part 2. Create a program using any loop that will provide the ff output.
*
***
*****
*******
*********
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 7 images