How to make calculator with input string in its operation selection?, i have tried but it doesn't work. My lecture assigned :)
printf("choose:");
scanf("%s", (char *) &choose);
switch(choose)
{
case 'tambah':
printf("Masukkan Nilai 1:");
scanf("%d", &x);
printf("Masukkan Nilai 2:");
scanf("%d", &y);
hasil = tambah(x,y);
printf("%d + %d = %d", x, y, hasil);
break;
case 'kurang':
printf("Masukkan Nilai 1:");
scanf("%d", &x);
printf("Masukkan Nilai 2:");
scanf("%d", &y);
hasil = kurang(x,y);
printf("%d - %d = %d", x, y, hasil);
break;