Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions