need programme to display time of 3.15pm instead of 2.75pm

case 1: printf("Please enter the selected time of leaving school.\n");
printf("Please enter in the time you would like to leave school at.\n"); // let user type in the time
printf("Example : 2.00,3.30,6.30.\n");
scanf("%f", &leavingtime); // store the time user leave school

if(leavingtime == 1.00) j=0;
if(leavingtime>1.29 && leavingtime<1.31) j=1; //let the computer know what time is the waiting time
if(leavingtime == 2.00) j=2;
if(leavingtime>2.29 && leavingtime<2.31) j=3; // j = extern file
if(leavingtime == 3.00) j=4;
if(leavingtime>3.29 && leavingtime<3.31) j=5;
if(leavingtime == 4.00) j=6;
if(leavingtime>4.29 && leavingtime<4.31) j=7;
if(leavingtime == 5.00) j=8;
if(leavingtime>5.29 && leavingtime<5.31) j=9;
if(leavingtime == 6.00) j=10;
if(leavingtime>6.29 && leavingtime<6.31) j=11;


time27=leavingtime+WaitingTime[j]+BUS27;
printf("Predicted time to reach home when taking bus 27 is :%.2fPm\n",time27); // calculate the time to reach home for bus 27

time45=leavingtime+WaitingTime[j]+BUS45;
printf("Predicted time to reach home when taking bus 45 is :%.2fPm\n",time45); // calculate the time to reach home for bus 45

time46=leavingtime+WaitingTime[j]+BUS46;
printf("Predicted time to reach home when taking bus 46 is :%.2fPm\n",time46); // calculate the time to reach home for bus 46

time69=leavingtime+WaitingTime[j]+BUS69;
printf("Predicted time to reach home when taking bus 69 is :%.2fPm\n",time69); // calculate the time to reach home for bus 69 *EXTRA
printf("\n\n");
break;
Topic archived. No new replies allowed.