Hi I'm a beginner at coding c and I'm trying to complete an assignment, but I'm not sure what I'm doing wrong here. I've followed what the book said but it's not working. My scanf are working for the double and the integer in my code but not for the character. Any help would be great appreciated.
Code:
int main(void) {
   int    userInt ;
   double userDouble;
   // FIXME: Define char and string variables
   char userChar;
   //string userString;
   printf( "Enter integer: \n");
   scanf("%d", &userInt);
   printf( "Enter double: \n");
   scanf("%lf", &userDouble);
   printf( "Enter character: \n");
   scanf ("%c", &userChar);
   // FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by a space
      printf("%d %lf %c \n", userInt, userDouble, userChar);


   // FIXME (2): Output the four values in reverse
   printf("%c %lf %d\n", userChar, userDouble,userInt);
   
   // FIXME (3): Cast the double to an integer, and output that integer
   printf("%lf cast to an integer is %lf\n", userDouble, userDouble);


   return 0;
}