0

calculator

#include<stdio.h> #include<conio.h> void main() { int a,b,ch; float result; clrscr(); printf("enter 2 nos\n"); scanf("%d%d",&a,&b); printf("1 for addition,2 for sub, 3 for multiplication,4 for div,5 for mod\n"); scanf("%d",ch); switch(ch) { case 1: result=a+b; printf("%f",result); break; case 2: result=a-b; printf("%f",result); break; case 3: result=a*b; printf("%f",result); case 4: result=a/b; printf("%f",result); break; case 5: result=a%b; printf("%f",result); break; default: printf("not a valid entery"); } getch(); } please tell me if any error in this code

15th Feb 2018, 6:58 PM
Surya
Surya - avatar
2 Réponses
0
c language
21st Feb 2018, 6:46 AM
Surya
Surya - avatar
- 1
What language is it?
15th Feb 2018, 7:07 PM
Jax
Jax - avatar