I'm going through the basics right now and reading books to seriously get into c++.
But I don't understand whats wrong with my code ?
For example if i write numbers 5 for a and 5 for b it gives me answer 21 when it should be 10?
Here's the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <cstdlib>
#include <iostream>
usingnamespace std;
int main(int argc, char *argv[])
{
int a;
int b;
int z;
z = a + b;
cout<<"Put numbers for a and b"<<endl;
cin>>a;
cin>>b;
cout<<"The sum of the numbers is "<< z <<endl;
system("PAUSE");
return EXIT_SUCCESS;
}