may i have some help? Here's my script.
#include <stdio.h>
void main(void) {
int u;
char ktp;
printf("Masukkan umur anda : ", &u);
scanf ("%i ", &u);
printf("Apakah anda memiliki ktp (y atau n): ", &ktp);
scanf ("%c", &ktp);
if (u>=17 && ktp=='y') {
printf("Selamat, anda layak untuk memilih.");
} else if(u<17) {
printf("Mohon maaf, anda belum layak untuk memilih.");
} else {
printf("Tolong masukan input yang benar.");
}
}
1.First of all, why i cant input the second input?? when I inputed the variable u, the value is immediately displayed without inputting the variable ktp. 2.how to make selection with yes or no and scan it to compare to the if else statement.