You are here:

C/please help

Advertisement


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.

regards
Joydeep Bhattacharya
http://www.scodz.com

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Joydeep Bhattacharya

Expertise

Ability to solve C and Data Structure problems and puzzles with simple and easy to understand logic.

Experience

C, C++, Java, Data Structure, PHP, Web Designing

Organizations
http://www.scodz.com Designation: webmaster

Publications
http://www.scodz.com

Education/Credentials
Master of Computer Applications

Past/Present Clients
http://analysingc.50webs.com http://www.funforu.com

©2012 About.com, a part of The New York Times Company. All rights reserved.