i m tyring to compiling the program of variables but it shows some errors and i have written everything same as the input of variables on this site what should i do can any1 help me please.
below is the input which i used for programming and in which i m encountering problem plz help me...
input:-
// operating with variables
#include <iostream>
using namespace std;
int main ()
{
// declaring variables:
int a, b;
int result;
// process:
a = 5;
b = 2;
a = a + 1;
result = a - b;
#include <iostream>
usingnamespace std;
int main ()
{
// declaring variables:
int a, b;
int result;
// process:
a = 5;
b = 2;
a = a + 1;
result = a - b;
// print out the result:
cout << result;
// terminate the program:
return 0;
}
I didn't modify anything, and the code ran fine for me. As shekhartanwar mentioned, could you please share your error message with us?
Based on Zero One's experience, it's more than likely it's the common Stdafx error. You can disable the Stdafx header. Simply follow my instructions below.
Instructions:
1) Open your project options
2) Under the C/C++ node, select: Precompiled Headers
3) In the first field, choose the option: Not Using Precompiled Headers.
Make sure you do the same for both Debug and Release versions.