C Program to find the difference of two integer numbers
User enters integer values for variable a and b, subtracts the two values and stores it in variable'difference'. The value stored at variable 'difference' is printed on the console.
Program
#include<stdio.h>
void main()
{
int a, b, difference;
printf("Enter two numbers:\n");
printf("a:\t");
scanf("%d", &a);
printf("b:\t");
scanf("%d", &b);
difference = a - b;
printf("Difference of %d and %d is %d\n", a, b, difference);
}
Output
Enter two numbers:
a: 7
b: 34
Difference of 7 and 34 is -27