C PROGRAM TO PERFORM ARITHMETIC OPERATIONS USING SWITCH LOOP :
#include<stdio.h> void main() { float value1,value2; char operator; printf("\n >>> PROGRAM TO PERFORM ARITHMETIC OPERATIONS USING SWITCH LOOP <<< \n"); printf("\n Enter Your Expression : "); scanf("%f %c %f",&value1,&operator,&value2); switch(operator) { case '+' : printf("\n Addition Result is : %f \n",value1+value2); break; case '-' : printf("\n Subtraction Result is : %f \n",value1-value2); break; case '*' : printf("\n Multiplication Result is : %f \n",value1*value2); break; case '/' : printf("\n Division Result is : %f \n",value1/value2); break; default : printf("\n Unknown operator"); break; } getch(); }
Output :
visit : C Program to Show the Operations of Arithmetic Operators
Vidmate download
ReplyDeleteMore c programming and interview programming questions
ReplyDelete