int main()
{
int a, b;
int result;
a = 5;
b = 4;
a = a + 1;
result = a - b;
cout <<result<<endl;
}
It might look really confusing at first, but when you actually sit down and read it slowly, it's pretty easy to understand.
In the code I provided, I'm saying that a = 5 and b = 2, then I'm taking a and adding 1 to it, then taking the new answer of a and subtracting it from b which would give me 2.
I just started learning yesterday :3
I'm using code::blocks for my C++ writing along with the www.cplusplus.com website.
|
|
Bookmarks