saadhamza
06-14-2009, 11:27 PM
ok, im really begining at c++. i know int means integer.so when i was writing a basic code liek this:
#include <iostream>
using namespace std;
int main ()
{
int a, b, c;
int result;
a= 9;
b= 12;
c= 459;
a= a + b + 2 * c -a * b;
result= a * b + 6;
cout << result;
cin.get();
return 0;
}
ok, <iostream> is blue because i was wondering, what exactly does that do in this code.
i made int main(); red because i thought integers were supposed to be used somewhere in the code again like the int. a, b, and c, and result. what does main() do?
#include <iostream>
using namespace std;
int main ()
{
int a, b, c;
int result;
a= 9;
b= 12;
c= 459;
a= a + b + 2 * c -a * b;
result= a * b + 6;
cout << result;
cin.get();
return 0;
}
ok, <iostream> is blue because i was wondering, what exactly does that do in this code.
i made int main(); red because i thought integers were supposed to be used somewhere in the code again like the int. a, b, and c, and result. what does main() do?