Calculator using switch-case in C

This is a C program to create a simple arithmetic calculator using switch-case statements.

It takes two numbers and an operator as input from the user and then performs the operation on the numbers.

Program: Calculator in C using switch-case

The reason for using %c instead of just % in 8th line of the code is explained here.

Output: Arithmetic calculator using switch-case in C output

Enter two numbers: 384 57
Enter an operator (+, -, *, /, %): -

The difference is: 327

C program to create simple calculator using if-else has been explained here.

Share your code and queries in the comments.

Share this code with your programmer friends and community.

Follow us on twitter.

About ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ

Linux and Python enthusiast, in love with open source since 2014, Writer at, India.

View all posts by ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ →

Leave a Reply

Your email address will not be published. Required fields are marked *