0
Doubt in c, this shows error , can any one tell me what is the error
int choice,number1,number2; printf("enter number1\n"); scanf("%d",&number1); printf("enter number2\n"); scanf("%d",&number2); printf("enter choice\n"); scanf("%d",choice); switch(choice) { case 1: printf("addition:%d",number1+number2); break; case 2: printf("subration:%d",number1-number2); break; case 3: printf("multiplication:%d",number1*number2); break; case 4: printf("division:%d",number1%number2); break; default: printf("out of range"); } return 0;
2 Respostas
+ 2
put your code in the playground for easier debugging please. pretty sure you need scanf("%d", &choice) instead of scanf("%d", choice)
0
got it friend thanks