Question When I run this program:
#include<stdio.h>
#include<conio.h>
int main()
{
int km, i;
float res, lt;
clrscr();
printf("Welcome to the Sears kilometers per liter calculator.\n\n");
for(i=1;i<=4;i++)
{
printf("\n\nEnter the number of kilometer for tank %d#: ",i);
scanf("%d",&km);
printf("Enter the number of liters used by tank %d#: ",i);
scanf("%f",<);
res = (float)km / lt;
printf("*** The kilometers per liter for tank %d# is %.1f",i,res);
}
getch();
}
I get an error message: "parse error before '<'"
Can you tell me what I am doing wrong?
Thanks in advance
Answer Hi Carl
The problem lies in line number 17,
scanf("%f",<); this line i think should be replaced by scanf("%f",<);
or some other float type variable.
Please do lemme know in case of any further problem with the code.