Today in this blog we will do arithmetic operations between two numbers using C program, you will get the solution and output below. If you have not done this program then see the solution or try to do it yourself.
console.log( 'Code is Poetry' );a#include
//C Program to perform all arithmetic operator (+, -, *, /, %)
int main(){
int num1, num2; //user input declare two variable
int sum, sub, mul, mod;
float div;
//input two number of user
printf("Enter 1st Number:- ");
scanf("%d",&num1);
printf("Enter 2nd Number:- ");
scanf("%d",&num2);
//perform all arithmetic operator
sum = num1 + num2; //Addition
sub = num1 - num2; //Substraction
mul = num1 * num2; //Multiplication
div = num1 / num2; //Division
mod = num1 % num2; //Module
//Print result all arithmetic operator
printf("Sum = %d",sum);
printf("\nSubstraction = %d",sub);
printf("\nMultiplication = %d",mul);
printf("\nDivision = %f",div);
printf("\nModule = %d",mod);
return 0;
}
Why you need both the bow with a corner bar some even considered shameful our