Program Simple Type Casting


    #include<iostream.h>
    int main( )
      {  
          // casts a double value as an int

            double v = 1234.56789;
             int n = int (v);
             cout << " v  =  " << v <<",  n  =  " << n ;
             return 0;
         }

0 comments:

Post a Comment

 
 
 
 


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