Identify all the errors of the following C++ program, write down the line number and the error you find. 1. winclude using name-space std; 2 Bint main() { int i, nbr nbr; 1/mbrnbr is for testing numbers double nbri =- e, nbrmax; 4 do { cout « "Enter the number of values to be tested : - cin » nbrnbr; 9 10 11 12 for(i==1; ic==nbrnbr; i+) 13 14 cout « "Enter the value number " «i « : cin >» nbrl; if (nbrmax < nbr1) nbrmax <= nbr1; 15 16 17 18 cout « "The greatest value" of those entered humbers is : " « nbrmax « endl; ) while(nbrnbr != 0); system("pause"); 19 20 21 22 Write and test the corrected C++ program and write down what is the output.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 1TF
icon
Related questions
Question
Identify all the errors of the following C++ program, write down the line number and the error you find.
#include <io stream>
2
using name-space std;
4.
Bint main()
6
int i, nbr nbr; I/nbrnbr is for testing numbers
double nbri == e, nbrmax;
do
{ cout « "Enter the number of values to be tested : " ;;
cin » nbrnbr;
9
10
11
12
for(i==1; ik==nbrnbr; i+)
13
14
cout « "Enter the value number " «i « "
cin >> nbr1;
if (nbrmax < nbr1)
15
16
17
nbrmax <= nbrl;
18
cout « "The greatest value" of those entered humbers is : " « nbrmax « endl;
} while(nbrnbr != 0);
system("pause");
19
20
21
22
Write and test the corrected C++ program and write down what is the output.
Transcribed Image Text:Identify all the errors of the following C++ program, write down the line number and the error you find. #include <io stream> 2 using name-space std; 4. Bint main() 6 int i, nbr nbr; I/nbrnbr is for testing numbers double nbri == e, nbrmax; do { cout « "Enter the number of values to be tested : " ;; cin » nbrnbr; 9 10 11 12 for(i==1; ik==nbrnbr; i+) 13 14 cout « "Enter the value number " «i « " cin >> nbr1; if (nbrmax < nbr1) 15 16 17 nbrmax <= nbrl; 18 cout « "The greatest value" of those entered humbers is : " « nbrmax « endl; } while(nbrnbr != 0); system("pause"); 19 20 21 22 Write and test the corrected C++ program and write down what is the output.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr