Problem with Visual C ++ visual


//This message appears when I run the program.

Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int h:\prog\consoleapplication1\consoleapplication1\source.cpp 4 1 ConsoleApplication1

can you fix it for me ???
Last edited on
Could you post your code?
#include<iostream>
using namespace std;
main()
{
int x, y, z;
z = x + y;
cout << "enter the first number" << endl;
cin >> x;
cout << "enter the second number" << endl;
cin >> y;
cout << "the sum is" << z << endl;


return 0;
}
Put "int" in front of main. You have other errors also.
what's the other errors ?
uninitialized variables. Solved it but putting "= 0" after each variable when you declare them.
thank you brother it's been solved
cout<<"thans Switchy"<<endl;
More so: You calculate z before x and y have values. Move z = x + y; after the last cin.
Topic archived. No new replies allowed.