Program to illustrate the labs( ) function


#include<iostream.h>
#include<conio.h>
#include<stdlib.h>                      // defines the labs( ) function
void main ( )
{
    long i ;
    i = -12345678L ;
    cout<<"\n i = "<<i ;
    cout<<"\n Absolute value of i = "<<labs(i);
    i = 12345678L ;
    cout<<"\n\n i = "<<i ;
    cout<<"\n Absolute value of i = "<<labs(i);
    getch() ;
}

0 comments:

Post a Comment

 
 
 
 


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