C Program To Find Subtraction Of Two Numbers
C Program To Find subtraction of two numbers
In this example, you will learn to calculate Subtraction Of Two Numbers Using printf() And scanf() Functions.
How Program Works ??
This Program Can Be Run By Two Ways (1) Using printf() Or (2) Using scanf()
If You Entered a=30 And B=20 Then
It Represent As sub = a - b;
where a = 30 , b = 20 And Answers Which Sub = 10;
Code For " Subtraction Of Two Numbers ", Using printf() Function.
/* Author --> HARSH PATEL */
#include<stdio.h>
void main()
{
int a = 50; //You Can Add Any Number
int b = 40; //You Can Add Any Number
int c = a - b; //Now int C Calculate subtraction Of Two Numbers Which You Added On a & b
printf("Subtraction Of Two Numbers = %d",c);
}
OUTPUT For "Subtraction Of Two Numbers ", Using printf() Function.
Subtraction Of Two Numbers = 10
Now Using
Function.
Now Code For " Find Subtraction Of Two Numbers ", Using scanf() Function.
/* Author --> HARSH PATEL */
#include<stdio.h>
int main()
{
int a,b,sub;
printf("Enter First Number : ");
scanf("%d",&a);
printf("Enter Second Number : ");
scanf("%d",&b);
sub = a - b;
printf("Subtraction Of Two Numbers = %d",sub);
return 0;
}
OUTPUT For "Subtraction Of Two Numbers ", Using scanf() Function.
Enter First Number : 50
Enter Second Number : 30
Subtraction Of Two Numbers = 20
- Now Program End Without Any Error.
Recommended,
- Sum Of Two Numbers In C
- Subtraction Of Two Numbers In C
- Multiplication Of Two Numbers In C
- Division Of Two Numbers In C
![🖥️](https://fonts.gstatic.com/s/e/notoemoji/14.0/1f5a5_fe0f/32.png)
![👨🎓](https://fonts.gstatic.com/s/e/notoemoji/14.0/1f468_200d_1f393/32.png)
![👩🎓](https://fonts.gstatic.com/s/e/notoemoji/14.0/1f469_200d_1f393/32.png)