Code:
#include <stdio.h>
4 #define mile 5280
5 #define kilometer 3282
6 void instructions (void);
7 int main()
8 {
9 int minutes;
10 scanf("%d", &minutes);
11 double seconds;
12 scanf("%lf", &seconds);
13 double totsec=(60*minutes)+(seconds);
14 double fps =(mile)/(totsec);
15 double mps=(1000.0/kilometer)*(5280.0/totsec);
16 printf(" That is %.1lf feet per second, and %.2f meters per second.\ n",fps,mps);
17
18 return 0;
19 }
20
21 void instructions()
22 {
23 printf("This program will ask for the minutes and seconds fo r the time it\ntook for a runner to run a mile. The program will then calcu late\nthe feet per second and meters per second for that runner.\n");
24
25
26
27 printf("\nMinutes for the runner: ");
28 printf("Seconds for the runner: ");
29
30 }
It compiled fine. But when i run a.out, the program doesn't display any text nor prompt the user for input.
But as grumpy correctly pointed out. I cannot nest a function within main.
My goal is to ("Write and call a function that displays instructions to the program user".)