CODE
#include <stdio.h>
#include <stdlib.h>
int main() {
// Declare the variables
int a, b;
// The user enters two integers
printf("Enter the first integer: ");
scanf("%d",&a);
printf("Enter the second integer: ");
scanf("%d",&b);
// Display the absolute values
printf("The absolute values of the integers are %d and %d.\\",abs(a),abs(b));
printf("The absolute value of the difference between the integers is %d.\\",abs(a-b));
return 0;
}
Step-by-step explanation
The header includes stdlib.h to call to abs() function.
Declare the variables a and b as integers.
Ask the users to enter the integers.
Display the absolute values of a and b.
Display the absolute value of a-b.