In this program, you will learn how the subtraction of two numbers takes place using two variables.
Actually, using less variables is preferred the most wherever possible. Rather, the same program can also be solved using three variables.
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Hope you found this 'C Program for Subtraction of Two Numbers(2 Variables)' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
Actually, using less variables is preferred the most wherever possible. Rather, the same program can also be solved using three variables.
---------------------------------------------------------------------------
Program for Subtraction of Two Numbers
/*Subtraction of Two Numbers using Two Variables*/
|
#include<stdio.h>
|
void main()
|
{
|
int
a, b;
|
printf("Enter Two Numbers: ");
|
scanf("%d %d", &a, &b);
|
printf("\nThe Subtraction of %d and %d is %d.",
a, b, a-b);
|
/*You can exclude
the step below.*/
|
printf("\ni.e. %d-%d=%d", a, b, a-b);
|
}
|
Output
Enter Two Numbers: 5 7
The Subtraction of 5 and 7 is -2.
i.e. 5-7=-2
---------------------------------------------------------------------------
Hope you found this 'C Program for Subtraction of Two Numbers(2 Variables)' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.

Comments
Post a Comment
Please do not comment any spam links in the comment box.