Can't find errors

1)what is wrong with the following program?
#include<iostream.h> //Line 1
using namespace std; //Line 2
int main() //Line 3
{
intx = 0; //Line 4
cout<<"x="<<x<<endl;
return 0;
}

2)what is wrong with the following program>
#include<iostream> //Line1
#include<cmath> //Line2
using std; //Line3
int main() //Line4
{
return 0; //Line5
}
Last edited on
try to use the #format when uploading code

1) intx = 0; should be int x = 0; and maybe you must include iostream instead of iostream.h

2)using namespace std; instead of using std;

Your compiler gives error messages, right? It isnt really hard to find those errors...
Don't give him his homework answers please.

There is also another issue with No1.'s code.
Topic archived. No new replies allowed.