Question: PLEASE FIND THE ERRORS, NOT THE OUTPUT III. Find the syntax errors in the following programs and fix them. 1. A simple program #include

PLEASE FIND THE ERRORS, NOT THE OUTPUT

III. Find the syntax errors in the following programs and fix them.

1.

\\ A simple program

#include

int main ( )

{

int a=10, b=24;

char ch = a;

cout << Sum = << a +b << endl;

cout << The character is : << ch;

<< endl;

return 0;

}

2.

// Second program

int main ( )

{

for ( y = 0.1; y != 1.0, y += 0.1 )

cout << y << endl;

cout << Last y = << y <

}

IV. Show the output of following programs.

1)

#include

#include

int main ()

{

int c = 0;

for (int i=0,j= 1; (i <=4 && j <=5); )

{

c += i+j;

cout << setw (5) << ++i << setw (5) << c << endl;

}

return 0;

}

____________________________________________________________

#include

int main ( )

{

int y =0;

int x =1, total =0;

while ( x <= 6)

{

y +=x ;

cout <<"Y ="<< y <

total += y;

++x;

}

cout << "Total is = " << total << endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!