How to get the value of a variable from an equation

I'm a newbie in c++ programming, and like the title explains. I need to figure out how to take two variables with values such as a 1; and b 2;. Now you take cout << a + b; and you will get 3, but I want to somehow have a 1; b 2;
and c num; then have a + b = c. So what ever I have the user input is for a and be added together will become the value of the c variable.
http://www.learncpp.com/cpp-tutorial/13-a-first-look-at-variables/
For you it is better to start from the very beginning:
http://www.learncpp.com/

correct sintax:
1
2
int c;
c = a + b;
Topic archived. No new replies allowed.