Infolinks - Earn Easy Money

Saturday, April 4, 2015

C++ program to find out the absolute value of number

#include <iostream>
using namespace std ;
int main (  )
{
int a=0 , b ;
cout <<" Enter the Number ";
cin >> a ;
if ( a < 0 )
{
b = a * -1 ;
cout <<" The absolute value of given number is " << cout << b ;
}
else
{
b = a ;
cout <<" The absolute value of given number is " << cout << b ;
}
return 0 ;
}

No comments:

Post a Comment

Must drop your comments about post.