I can't get it right.

#include<stdio.h>
#define LITRES 20
int main()
{
int convert;
float convertt;
printf ("Enter a number between 10 to 20 gallons:")
scanf("%d,", &convert); <---There's an ERROR here

convert = 10

while ((convert >=10)&& (convert <= LITRES); <------- ERROR here
{
convert = 3.785* convert;
printf ("%d,%f", convert,convertt); <---- And ERROR over here
convert++;
}

return 0;
}

Can anyone explain to me the mistakes I have committed. Thanks

Check semicolons and parentheses, if you read the error messages you should find how to fix this.
You realise you're trying to get user input for convert, and then manually assigning convert the value of 10.
You forgot a semicolon after your first printf and put an extra forbidden semicolon after while header.
Topic archived. No new replies allowed.