Answer to Question #237025 in C++ for c++

Question #237025

identify errors in the following c++ program

#include<iostream>

void main()

{

int i=0;

i=i+1;

cout <<i << " " ;

/*comment \*//i=i+1;

cout <<i;

}


1
Expert's answer
2021-09-14T07:35:47-0400

If you try to run this program the compiler will display the following error messages:





Correct code:


#include<iostream>
using namespace std; // for cout
void main(){
	int i=0;
	i=i+1;
	cout <<i << " ";
	/*comment */
	i=i+1;
	cout <<i;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS