Find the absolute value of an Integer


 Using abs:

#include <stdio.h>
#include <stdlib.h>
int main(){
int number,value;
printf("Enter any Negative Number:");
scanf("%d",&number);
// Find absolute
value = abs(number);
// Print the absolute value
printf("Absolute Value of %d is %d", number, value);
return 0;
}

Comments