for(i=0; i< MAXNUM; i++)
{
printf("Please enter the Date your journey started: \n\n");
gets(&datestart[i]);
printf("Please enter where your travelling too: \n\n");
gets(&fromto[i]);
printf("Please enter the time your journey started: \n\n");
gets(×tart[i]);
printf("Please enter the time your journey Ended: \n\n");
gets(&timefinish[i]);
printf("Please enter the Distance travelled: \n\n");
scanf("%f",&distance);
printf("Please enter the price of fuel the last time you filled:\n");
scanf("%f",&fuelCost);
fflush(stdin);
}
printf(" the logbook is as follows:\n");
printf("%10s %10s %10s %10s %10s %10s\n", "Date", "Destination", "Start Time" ,"Finish Time", "Distance" ,"Fuel Cost");
{
for (j=0; j<MAXNUM ; j++)
printf("%10s %10s %10s %10s %10f $%10.2f\n" ,&datestart[j], &fromto[j], ×tart[j], &timefinish[j], distance, fuelCost);
}
What i want the code to do is to print the array members in a table using a loop so that i can add multiple entries in one hit. Sorry iam very new to C any help would be appreciated as my assignment is due in a few hours time........
41.7 percent of all statistics are made up , honest