Got it! Thanks!
Type: Posts; User: PlusA2T
Got it! Thanks!
Still no so understand...Why do the function "getchar()" make it works! It means I have to catch the "\n" myself? (But seems that scanf will ignore?)
Lastly, My code here:
//
// BMIC.c
// ...
Not so understand that..
Do it means scanf() is hard to do this? and where can I found lots of reference of C(like PHP: php.net)? (Not C++ or C#)
Only let user input float and if not then yell user...
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
float height = 0, weight = 0, BMI = 0;
int OK = 0;
printf("Welcome to BMI calculator.\nPlease type your height first(in...
But why do the complier don't run my script?
zero..
EVEN haven't print any msg at first time it step in else{}!
This is a BMI Calculator..That's no problem when using correctly.(Typing correct number)
But, if I'm a bad guy and typing some letters…It would show “Don't trick me, Again(in Meters):” repeatedly...