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

13y 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 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 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 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

Trending Questions
What to do if the voltage is to high in your house? Is it True malloc function allocates a single block of storage space and sets all bytes to zero in C programming language? What is the order of efficiency of venturi meter orifice meter and rotoameter? Is MTech beneficial or MBA for mechanical engineer? Can you play Nintendo DS games on VisualBoy Advance? What is an unintended high-current closed connection between two points in a circuit called? What is the Luhya word for engine? What plumbing tools should I buy to fix my leaky sink? What is a storage area item you should step on carefully? What happens to waveform on oscilloscope when we increase the voltage level from function generator? What is called if an assembler that runs on one machine but produce machine code for another machine? What are the applications of Time Division Multiplexing technique? A red resistor draws more current than a blue resistor when they are connected to the same battery which resistor has the lower resistance? Using scientific knowledge of forces to build a construction crane is an example of? Disadvantages of a squirrel cage motor? Why do the transmission cables need to be thicker when power is transmitted at a lower voltage over long distances? What is forced cooling in transformers and name and explain them? Is a principal of KV a gazzetted officer? For 225 kw motor what is the amps star and delte and what is the cable size required? What meaning circuit breaker 400af 300 at?