C++ Basic Arithmetic

 




Basic Arithmetic

Any statement enclosed with double quotes (" ") in a cout statement is displayed
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

Popular posts from this blog

JSS1 COMPUTER STUDIES FINAL EXAM QUESTIONS

JSS3 COMPUTER STUDIES PAPER III PRACTICAL