stop using scanf() because it may corrupt the input buffer and leave keys in the keyboard buffer. use fgets() instead
float num;
char buf[16];
printf("blabla");
// get input from user
fgets(buf,sizeof(buf),stdin);
// convert to float
num = atof(buf);
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
>> while(Pds >100);
that is an infinite loop because of the semicolon at the end. Your program will never stop executing that loop because the value os Pds never changes. This is a common error that everybody counters on occasion due to carelessness.
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
while ( Pds > 100 ) ; is equivalent to
while ( Pds > 100 )
{
// sit back and enjoy baby
}
Like Mr. Dragon said the variable which controls the run of your "While " loop never changes and so it goes on for infinity.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733