1. How to add ,subtract,multiply and divide two numbers without using third variable
#include<stdio.h>
void main()
{
int a=5,b=2;
printf("Sum is : "%d,(a+b));
printf("Subtraction is : "%d,(a-b));
printf("Multiplication is : "%d,(a*b));
printf("Division is : "%d,(a/b));
}
Output :
Sum is: 7
Subtraction is : 3
Multiplication is : 10
Division is : 2
#include<stdio.h>
void main()
{
int a=5,b=2;
printf("Sum is : "%d,(a+b));
printf("Subtraction is : "%d,(a-b));
printf("Multiplication is : "%d,(a*b));
printf("Division is : "%d,(a/b));
}
Output :
Sum is: 7
Subtraction is : 3
Multiplication is : 10
Division is : 2
No comments:
Post a Comment