Addition ( c = a + b & c = a * b)
Published Sep 27, 2008
Updated Oct 04, 2008
To work with console in C++, you must launch the iostream.h
To Import data you are using cin
, and for print you are using cout
- This command signify start of new row.
- Just print the result of var and string's at the exit. And every cout
command signify start of new row or end of the extant row.
- This command is to separete two datas.
- When the code is performed by any Windows IDE, with this command you are pausing the program, to see result and then to close the program.
using namespace std;
void main(int argc, char *argv)
int a, b, c;
cout <<"Enter value for a: ";
cin >> a;
cout <<"Enter value for b: ";
cin >> b;
c = a + b;
cout <<"a + b = "<<c<<endl; //new row
c = a * b;
cout <<"a * b = "<<c<<endl;
cout <<"Thank You."<<endl;