C Program to find absolute value

C Program to find absolute value



#include
#include
void main()
{
int a,b;
clrscr();
printf("enter the value of a");
scanf("%d",&a);
if(a<0)
{
b=a*-1;
printf("\nabsolute value of %d is %d",a,b);
}
else
{
printf("\nabsolute value=%d",a);
}
getch();
}


No comments:

Post a Comment