I wrote program in C , but after compiling and running it the output console does not stay on after I enter anything. My program requires to enter distance and time.
My code is here:
#include <stdio.h>
int spd(int x , int y);
int main() {
int x,y;
printf("enter the distance first then time in their SI units :\n");
scanf("%d",&x);
scanf("%d",&y);
printf("the speed required is ",spd(x,y));
getch();
return 0;
}
int spd(int x , int y) {
return x/y;
}