0

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
  • 21,411
  • 5
  • 55
  • 102
Vivek Singh
  • 11
  • 1
  • 4

1 Answers1

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

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

sjsam
  • 21,411
  • 5
  • 55
  • 102