This is the code...what iam trying to do is that
i am checking whther the date entered by user is valid...i.e lies btw begin date and end date...
if the condition is true
the next step is to enter the time slot btw which i want to see flights departing frm all cities...
/*CODE*/
while(fscanf(fp,"%s %d %d %d %d %d %s %d %s %d\n",ia.car,&ia.ait,&ia.fno,&ia.dop,&ia.beg,&ia.end,ia.org,&ia.dep,ia.des,&ia.arr) != EOF){
printf("Enter date (YYMMDD): ");
scanf("%d",&dat);
if((ia.beg<=dat) && (dat<=ia.end))
{
printf("Please Enter the time slot(x-y): ");
scanf("%d %d",&x,&y);
if(ia.dep>=x && ia.dep<=y)
printf("%s\n",ia.org);
}
}
for example the 1st three lines of input file are
IC 320 0012 146 030201 030329 AMD 0610 BOM 0710
IC 320 0036 7 021101 030328 AMD 0635 DEL 0800
IC 320 0037 7 021101 030328 DEL 2100 BOM 2255
now let suppose user enters
input date: 021229
now this means this date is valid for last two sectors/lines
after this user enters time slot as : 0600 and 0700
the output of which shud be
origin: AMD
i know iam going wrong somwhere but can't find my mistake.
please help
regards