//*** Introducing using of the functions *** /* This is the third example of timeconvert function. In this example, timeconvert takes the required inputs from the main program. The calculation of time is done in the function. Finally the function returns the answer to the main body. Same as previous example, the main program prints the calculated time on the screen. */ #include #include //Defining Our Function int timeconvert(int h, int m, int s) { //There is no need to declare the variables which is introduced as the input of the function, again. int t; t=(h*3600)+(m*60)+s; return t; } //Starting The Main Body void main() { int x,a,b,c; clrscr(); printf("Enter your time in the following format:\nhours\nminutes\nseconds\n"); scanf("%d%d%d",&a,&b,&c); x=timeconvert(a,b,c); printf("The total time is equal to %d seconds.\n",x); getch(); }