New to c++ language. Need help.

Vanna Guo's Avatar, Join Date: Feb 2010
Newbie Member
I know this is a ridiculous question but I've only just started to learn c++ a few days ago, I'm trying to figure out how to add 12 and 33 together. So I want the sum to display 45.

this is what I have so far:

#include <iostream>
using namespace std;
int main ( ) {

a = 12;
b = 33;
char sum;
sum = a + b;

cout << "The sum of 12 and 33 is " << sum;
cout << "\n";

return 0;

please help me and my stupidity, and thank you very much!
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Why on earth you are trying to add two numbers into a character?
xpi0t0s's Avatar, Join Date: Aug 2004
int a=12;
int b=33;
int sum;
cout << a << "+" << b << "=" << sum << endl;