My program is giving me a problem when i error check it an run it after i input wrong data it skips the thing an moves on an also i need guidance or a hint as to how the time minus thing and what exactly is rounded time as i was instructed to put it in but im not exactly sure as to what it is
Code:#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { char vehicle[15]; int car; int truck; int hrsn, minn; int hrso, mino; int time; int rt; hrsn=0; hrso=0; minn=0; mino=0; printf("Where you driving a car or truck?\n"); scanf("%s", &vehicle ); printf("What Hour did the %s enter the lot? (0-23)\n", vehicle); scanf("%d",&hrsn); if((hrsn<0 || hrsn>23)) { printf("\a\a\a Please Input Value from 0-23!\n"); } else { printf("What Minute did the %s enter the lot? (0-59)\n", vehicle); scanf("%d",& minn); } if((minn<0 || minn>59)) { printf("\a\a\a Please Enter Correct Minute Between 0-59!\n"); } else { printf("What Hour did the %s leave the lot? (0-23)\n", vehicle); scanf("%d",& hrso); } if((hrso<0 || hrso>23)) { printf("\a\a\a Please Enter the Correct Time Between 0-23!\n"); } else { printf("What Minute did the %s leave the lot? (0-59)\n", vehicle); scanf("%d",& mino); } if(mino<0 || mino>59) { printf("\a\a\a PLease Enter the Correct time between 0-59!\n"); } else { rt = hrso - hrsn && mino - minn; printf("Time in %d:%d\n", hrsn, minn); printf("Time out %d:%d\n", hrso, mino); printf("Parking Time %d\n", time); printf("Rounded time %d\n", rt); } return 0; }



LinkBack URL
About LinkBacks


