Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a program to add a given duration with time(24hrs format)



Write a program to add a given duration with time(24hrs format) ..

Answer / heena r yeole

#include<stdio.h>
int main (void){

int dept1,dept2,dept3,dept4,dept5,dept6,dept7,dept8,hh,mm,entertime;

printf("Enter a time in 24-hour format:");
scanf("%d:%d",&hh,&mm);


dept1=8*60;
dept2=9*60+43;
dept3=11*60+19;
dept4=12*60+47;
dept5=14*60;
dept6=15*60+45;
dept7=19*60;
dept8=21*60+45;

entertime=hh*60+mm;

if(entertime<=dept1){
printf("Closet Departure time is 8:00 A.M,arriving at 10:16 A.M");
}else if(entertime<=dept2){
printf("Closet Departure time is 9:43 A.M,arriving at 11:52 A.M");
}else if(entertime<=dept3){
printf("Closet Departure time is 11:19 A.M,arriving at 1:31 P.M");
}else if(entertime<=dept4){
printf("Closet Departure time is 12:47 P.M,arriving at 3:00 P.M");
}else if(entertime<=dept5){
printf("Closet Departure time is 02:00 P.M,arriving at 4:08 P.M");
}else if(entertime<=dept6){
printf("Closet Departure time is 03:45 P.M,arriving at 5:55 P.M");
}else if(entertime<=dept7){
printf("Closet Departure time is 07:00 P.M,arriving at 9:20 P.M");
}else if(entertime<=dept8){
printf("Closet Departure time is 09:45 P.M,arriving at 11:58 P.M");
}

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More C Interview Questions

What is the difference between printf and scanf )?

0 Answers  


How to run c Program without using IDE of c. means if program made in notepad.then how to compile by command prompt.

1 Answers   HP, TCS,


What is c system32 taskhostw exe?

0 Answers  


write a program for size of a data type without using sizeof() operator?

22 Answers   HCL, IBM,


How can you increase the allowable number of simultaneously open files?

0 Answers  


the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters

2 Answers  


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

0 Answers  


The difference between printf and fprintf is ?

0 Answers   Baan Infotech,


Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986

1 Answers  


Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; }

3 Answers   Qualcomm,


Why is c platform dependent?

0 Answers  


Taking an example,differentiate b/w loader and linker ?

1 Answers  


Categories