C++ Program To Substract Two Numbers
Input:
#include<stdio.h>
int main()
{
int a,b,sub;
printf("Enter the first no.: ");
scanf("%d",&a);
printf("Enter the second no.: ");
scanf("%d",&b);
sub= a-b;
printf("subtract is = %d\n", sub);
return 0;
}
Output:
First run:
Enter the first no.: 10
Enter the second no.: 18
subtract is = -8
Second run:
Enter the first no.: 25
Enter the second no.: 10
subtract is = 15
*** Use Turbo C/C++ Or Dec C++ For Coding ***
Output:
First run: Enter the first no.: 10 Enter the second no.: 18 subtract is = -8
Second run: Enter the first no.: 25 Enter the second no.: 10 subtract is = 15
0 Comments:
Post a Comment