C++ Basic Arithmetic
Basic Arithmetic
directly and any arithmetical or logical expression is evaluated and then the result
is displayed. The program below shows the result of the expression 3 + 5.
/*
PROG: C1_03sum.cpp
*/
#include <iostream>
using namespace std;
int main()
{
cout <<"5 + 3 = "<<5+3<<endl; //calculate and print the sum
system("pause");
return 0;
}
5 + 3 = 8
Press any key to continue . . .
Comments
Post a Comment