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. 

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to check age of any student is teen age or not.