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;

26th Aug 2018, 11:29 AM
shahul hameed aljas TA
shahul hameed aljas TA - avatar
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)
26th Aug 2018, 11:42 AM
hinanawi
hinanawi - avatar
0
got it friend thanks
26th Aug 2018, 11:45 AM
shahul hameed aljas TA
shahul hameed aljas TA - avatar