Write a c program to subtract two numbers.

Get two integer numbers, subtract both the integers and display the difference

Sample Input 1:

6 5

Sample Output 1:

1

Sample Input 2:

65 4

Sample Output 2:

61

Program or Solution

#include<stdio.h>
int main()
{
	int num1,num2,diff;
	printf("Enter two numbers:");
	scanf("%d %d",&amp;num1,&amp;num2);
	diff=num1-num2;
	printf("\nDifference is : %d",diff);
	return  0;
}

Out Put

Enter two numbers: 6 5 Difference is : 1

LEAVE A REPLY

Please enter your comment!
Please enter your name here