c programming absolute value code example
Example 1: c absolute value
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
printf("ABSOLUTE VALUE\n\nNumer: ");
scanf("%d",&a);
if(a < 0)
{
a = a * (-1);
}
printf("Absolute value: %d\n\n", a);
system("pause");
}
Example 2: how to absolute value in c
int abs(int x);