プログラムをCで作成しましたが、コンパイルして実行した後、何かを入力しても出力コンソールがオンのままになりません。私のプログラムでは、距離と時間を入力する必要があります。
私のコードはここにあります:
#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;
}