1. C Program to Calculate Addition and Subtraction of two numbers.
How does this program work?
- In this program you will learn about how to find addtion and subtraction of two numbers.
- Initially the integer entered by the user is stored in two variables a,b.
- After that by using the given logic you will get output using c-Language.
Here is the code
#include <stdio.h>
int main(void)
{
int a, b,sum,diff;
//Int represents integers
printf("Enter two numbers: \n");
scanf("%d%d",&a,&b);
sum = a+b;
diff = b-a;
printf("Addition of two number=%d\n", sum);
printf("Difference of two numbers=%d",diff);
return 0;
}