0
int userinput;
char convertfrom;
float value;

printf("What do you want to convert? Enter number from 1 to 5: ");
scanf("%d", &userinput);

if (userinput == 1) {
printf("enter letter K or P: ");
scanf("%c\n", &convertfrom);
printf("letter = %c", convertfrom);
}

I input "P" for the second scanf that asks for a letter, but the code keeps failing to print "letter = P". instead it only prints "letter = ". Why can't I print the user input?

0 Answers0