getchar();语句没有执行是怎么回事?
/*20170629 The program is designed to convert inches to centimeters.
*/
#include <stdio.h>
int main(void)
{
float cm, inches;
printf("Please enter a inches count\n");
scanf("%f", &inches);
cm = inches*2.54;
printf("The result is %fcm .\n", cm);
getchar();
return 0;
}
结果:
Please enter a inches count
1
The result is 2.540000cm .
--------------------------------
Process exited after 2.521 seconds with return value 0
请按任意键继续. . .