Submit Your Email Now : To get latest programming tutorials directly in your inbox ! Hurry Up !!

## Write A Program In C To Create A Simple Arithmetic Calculator ( Using Switch Case )

#### What is Arithmetic Calculator :-

Arithmetic calculator is one type of calculator in which you can  do some Arithmetic operations between numbers like Addition (+) , Subtraction (-) ,Multiplication (x) and Division (/) .

#### Program Details :-

This program is a very simple program . in this program i have used one switch case  to carry out all the

arithmetic operations as individual cases. and another  if statement to display the result.

## Complete Program To Create A Simple Arithmetic Calculator

//Source Code By CodingMagazine.blogspot.com
#include<conio.h>
#include<stdio.h>

int main()
{
int num1,num2,result=0;
char choice;
clrscr();
printf("\n Enter 1st Number=");
scanf("%d",&num1);
printf("\n Enter 2nd Number=");
scanf("%d",&num2);
fflush(stdin);
scanf("%c",&choice);

switch(choice)
{
case '+':
result=num1+num2;
break;
case '-':
result=num1-num2;
break;
case '*':
result=num1*num2;
break;
case '%':
result=num1%num2;
break;
default:
printf("\n Please Enter a Valid Choice");
break;
}//Switch Ends

if(result>0)
printf("\n Result is=%d",result);

getch();
return(0);

}//Main Ends
Any  Help ??
If  You are facing any kind of problem while running the program , then please feel free to ask me by using below comment box (Thanks Also Accepted for successful program execution :) ).