-1

scanf("%c", &ch ) do not read the character from console while scanf(" %c", &ch ) does, the snipet from code is given under

printf("If the value of speed of sound is known enter Y else enter N");
scanf(" %c", &ch );
sjsam
  • 20,774
  • 4
  • 49
  • 94
Vivek Singh
  • 1
  • 1
  • 4

1 Answers1

0
scanf(" %c", &ch );

This space before the %c is, probably, taking care of the buffered newline character. See [ this ] answer.

sjsam
  • 20,774
  • 4
  • 49
  • 94