Program for illustration of Type Conversions


    #include<iostream.h>
    int main( )
   {
         int n = 22;
         float x = 3.14159;
         x= x+ n;                // the value 22 is automatically converted to 22.0
         cout << x - 2 ;       // the value 2 is automatically converted to 2.0
         return 0;
    }

0 comments:

Post a Comment

 
 
 
 


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