In the following statements you may find some errors. Line number are included to the left of each line to help with your answers. Hint: number of points equals at least the number of errors.
1: */ what’s wrong with this program? /*
2: #include iostream
3: using namespace std;
4: int main();
5: }
6: int x,y,z \\ Three integers
7: x=24
8: y=84;
9: z=x+y,
10: Cout<"The value of z is "<Z;
11: Return;
12: {
Error1 -Line 2 - #include iostream -> correct version is - #include<iostream>
Error2 - Line 5 - } -> correct version is - {
Error3 - Line 6 - int x,y,z -> correct version is - int x,y,z;
Error4 -Line 7 - int x= 24 - > correct version is - int x = 24;
Error5 - Line 9 - z=x+y, -> correct version is - z=x+y;
Error6,7 and 8(three errors, one is with the Cout and other is with the Z is in uppercase and cout<< is the correct syntax)- Line 10 - Cout<"The value of z is "<Z; -> correct version is -> cout<<"the value of z is "<<z;
Error 9: Return; -> correct version is -> return;
Error10: Line 12 -> { -> correct version is -> }
Hope I answered the question, if you have any doubts, feel free to ask
And if you like my answer then please upvote.
Thank you!
Get Answers For Free
Most questions answered within 1 hours.