Program to input two number and print their subtraction in C.
In this program we input two and print their subtraction. This is 3rd program of C including "Hello World".
/*Program to subtract two number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,s=0;
clrscr();
printf("Enter 1st number=");
scanf("%d",&a);
printf("Enter 2nd number=");
scanf("%d",&b);
s=a-b;
printf("Subtraction=%d",s);
getch();
}
OUTPUT
Note:- If you want to calculate floating value then you can use "float",for both use "double" replace "int".
For more updates follow on "Google+".
Related Examples
1.Write a program to input two number and print their sum.
2.Write a program to input two number and print their multiplication.
/*Program to subtract two number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,s=0;
clrscr();
printf("Enter 1st number=");
scanf("%d",&a);
printf("Enter 2nd number=");
scanf("%d",&b);
s=a-b;
printf("Subtraction=%d",s);
getch();
}
OUTPUT
Note:- If you want to calculate floating value then you can use "float",for both use "double" replace "int".
For more updates follow on "Google+".
Related Examples
1.Write a program to input two number and print their sum.
2.Write a program to input two number and print their multiplication.

Comments
Post a Comment