answersLogoWhite

0

#include

int main(){

int a, b, choice;

printf("This program implements a calculator\n");

do{

printf("Enter your choice:\n1-Addition\n2-Subtraction\n3-Multiplication\n4-Division\n5-Modulus\n6-Quit\t:");

scanf("%d", &choice);

switch(choice){

case 1: printf("Enter two numbers :");

scanf("%d%d", &a, &b);

printf("Sum = %d\n", a+b);

break;

case 2: printf("Enter two numbers :");

scanf("%d%d", &a, &b);

printf("Subtraction = %d\n", a-b);

break;

case 3: printf("Enter two numbers :");

scanf("%d%d", &a, &b);

printf("Product = %d\n", a*b);

break;

case 4: printf("Enter two numbers :");

scanf("%d%d", &a, &b);

printf("Quotient = %d\n", a/b);

break;

case 5: printf("Enter two numbers :");

scanf("%d%d", &a, &b);

printf("Remainder = %d\n", a%b);

break;

case 6: break;

default: printf("Invalid choice\n");

}

}while(choice != 6);

return 0;

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What are the Example Output of Calculator Program in C plus plus?

example output of c++ calculator


How can you spell calculator in a calculator?

on a fxMs-82s Casio calculator C A 1 C U 1 A 7 0 (square root sign)


How do you make a scientific calculator in c plus plus?

#include <stdio.h> int main() { printf("the answer is 42"); }


What is the source code for scientific calculator in c?

What is the source code for scientific calculator in c?Read more: What_is_the_source_code_for_scientific_calculator_in_c


What does the the letter C stand for on a calculator?

"C" = clear - pressing it sets all the calculations in the calculator back to zero.


Can a potato power a calculator?

c


What does the c mean on a calculator?

clear


What things in a backpack start with C?

calculator


How do you put y equals c in a calculator?

if u have a regular calculator, you cannot put y =, if u have a graphing calculator, then you press the "y =" button


How do you make trigonometric calculator in c plus plus?

include file math.h and you get most C++ functions for trigonometry, for instance,sin(), cos(), tan(), asin(), acos(), and atan() etc.


How do you write mixed fractions on a calculator?

It depends on the calculator; usually there's an "a b/c" button, which is activated when you press shift or a "2nd function" button on the calculator. However if this does not help, most calculators now have online instruction manuals. Just type the model and make into google.


How many combinations of four can you make out of 6?

type in your calculator C(6,4) like the combination of 6 things taken 4 at a time