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
Share your code and queries in the comments.
Share this code with your programmer friends and community.
Follow us on twitter.