Find the absolute value of a number entered by the user.

Find the absolute value of a number entered by the user.



#include<iostream>
using namespace std;
int main()
{
float x;
cout<<"\t * Absolute Value of Numbers * "<<endl;
cout<<"\n";
cout<<"Enter the number whose absolute value you want to know"<<endl;
cin>>x;
if (x>0)
{
cout<<"The Absolute Value of your entered number is "<<x<<endl;
} else {
cout<<"The Absolute Value of your entered number is "<<-x<<endl;
}
}


Find the absolute value of a number entered by the user.