#include<stdio.h>
#include<conio.h>
void main()
{
int value1, value2, addition, subtraction, multiply;
float divide,mod;
clrscr();
printf("\n Enter the value1: ");
scanf("%d",&value1);
printf("\n Enter the value2: ");
scanf("%d",&value2);
addition = value1 + value2;
subtraction = value1 - value2;
multiply = value1 * value2;
divide = value1 / (float)value2;
mod = value1 % value2;
printf("\n Addition = %d + %d = %d",value1,value2,addition);
printf("\n Subtraction = %d - %d = %d",value1,value2,subtraction);
printf("\n Multiplication = %d * %d = %d",value1,value2,multiply);
printf("\n Division = %d / %d = %.0f",value1,value2,divide);
printf("\n Modulo = %d MOD %d = %.0f",value1,value2,mod);
getch();
}
#include<conio.h>
void main()
{
int value1, value2, addition, subtraction, multiply;
float divide,mod;
clrscr();
printf("\n Enter the value1: ");
scanf("%d",&value1);
printf("\n Enter the value2: ");
scanf("%d",&value2);
addition = value1 + value2;
subtraction = value1 - value2;
multiply = value1 * value2;
divide = value1 / (float)value2;
mod = value1 % value2;
printf("\n Addition = %d + %d = %d",value1,value2,addition);
printf("\n Subtraction = %d - %d = %d",value1,value2,subtraction);
printf("\n Multiplication = %d * %d = %d",value1,value2,multiply);
printf("\n Division = %d / %d = %.0f",value1,value2,divide);
printf("\n Modulo = %d MOD %d = %.0f",value1,value2,mod);
getch();
}
OUTPUT:
calculator.c |
RELATED PROGRAMS
a. Writea program to print ―HELLO FRIENDS!!
c. Writea program to convert years intomonths and days.
d. Write a program to solve Quadratic Equation.
d. Write a program to solve Quadratic Equation.
No comments:
Post a Comment