C program to enter two numbers and perform all arithmetic operations.




C program




*****************************************


//To enter two numbers and perform all arithmetic operations.

#include<stdio.h>
main()
{
int a,b,sum,sub,multi,div,mod_div;
printf("\n Enter First number\n");
scanf("%d",&a);
printf("\n Enter Secand number\n");
scanf("%d",&b);
sum=a+b;
sub=a-b;
multi=a*b;
div=a%b;
mod_div=a/b;
printf("\n sum=%d",sum);
printf("\n sub=%d",sub);
printf("\n multi=%d",multi);
printf("\n div=%d",div);
printf("\n mod_div=%d",mod_div);
}

                                         OUT PUT

                                Enter First number =5

                                Enter Secand number=6

                                 sum=11
                                 sub=-1
                                 multi=30
                                 div=5
                                 mod_div=0
                                 --------------------------------


*****************************************

                                                   

 Related Question



➤Write a C program to enter length and breadth of a rectangle and find its perimeter. 

➤Write a C program to enter length and breadth of a rectangle and find its area.

➤Write a C program to enter radius of a circle and find its diameter, circumference and area. 

➤Write a C program to enter length in centimeter and convert it into meter and kilometer

 ➤Write a C program to enter temperature in Celsius and convert it into Fahrenheit

➤Write a C program to enter temperature in Fahrenheit and convert to Celsius 

Write a C program to convert days into years, weeks and days.
*********************************************