Program to illustrate Arithmetic Operators


     # include <iostream.h>
     int main( )
     {
          int a =54, b = 20 ;  // Dynamic initialization
          cout <<" \n a =  "<<a<<"  and  b  =  "<<b ;
          cout<<" \n a + b  =  " << a+b ;                        // 54 + 20
          cout<<" \n a - b  =  " << a - b ;                        // 54 - 20
          cout<<" \n a * b  =  " << a * b ;                      // 54 * 20
          cout<<" \n a / b  =  " << a / b ;                        // 54 / 20
          cout<<" \n a % b  =  " << a % b ;                    // 54 % 20
          return 0;
      }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|