Program to illustrate the abs( ) function


    #include <iostream.h>
    #include <math.h>                      // defines the abs( )  function
      #include <conio.h>
    void main ( )
    {
           int i ;
        i = -20 ;
        cout<< "\n i = "<<i ;
           cout<<"\n Absolute value of i =  "<<abs( i ) ;
        i = 20 ;
        cout<< "\n i = "<<i ;
           cout<<"\n Absolute value of i =  "<<abs( i ) ;
        getch ( ) ;   
    }

0 comments:

Post a Comment

 
 
 
 


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