I'm working on Pset1 and I keep getting an 'unused variable' error in my do/while loop. This is my code-
int main(void)
{
printf("How much change is owed?\n");
float fcents = GetFloat()*100.0;
if (fcents<=0)
{
do
{
printf("How much change is owed?");
float fcents = GetFloat()*100.0;
}
while(fcents<=0);
}
int icents = (int) round(fcents);
printf("integer cents: %d \n", icents);
}
I'm using the variable in the 'while' so the loop should run again. Ive checked the syntax many times and it looks right to me. What am I missing? Thanks!