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;
}
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;
}
Comments
Leave a comment