Posts

Showing posts with the label programming

C++ Basic Arithmetic

Image
  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 . . .