C-Code to find the absolute value of a number entered through the keyboard.

#include<stdio.h>
void main()
{
int gno;
printf("Enter any number to find its Absolute number :");
scanf("%d",&gno);
if(gno<0)
printf("\nThe absolute value of given number is: %d",-1*gno);
else
printf("\nThe absolute value of given number is: %d",gno);
}

                        OR
#include<stdio.h>
#include<math.h>
void main()
{
int gno;
printf("Enter any number to find its Absolute number :");
scanf("%d",&gno);
printf("\nThe absolute value of given number is: %d",abs(gno));
}