Hi, my friend recently tried writing a program to do his physics homework calculations(instead of using...yknow a calculator), but there's this weird problem it's been having.

Initially I thought it was because of how he wrote his scanf's, so I just sorta had some fun and rewrote it since I haven't coded in a while.

He wrote it with the variables for the calculations as doubles, so all the decimal places would be shown, but it doesn't show any of the digits to the right of the decimal point(it just puts 0s there) and some of the functions won't even run. I rewrote it w/ the variables set to int and it will run every function fine, but we don't get all the decimals.

Why won't this program run with the doubles!?!?

Below is the code...it's a lot of stuff because I wanted to try and recall some of my old skills so I did unnecessary things, probably wasting lines and time >.<

this was compiled and written in Dev-C++ 5.0 w/ the MingW Compiler packaged w/ it.
Code:
#include<stdio.h>
#include<math.h>
//Functions
void printMenu(),speedCacl(),timeCacl(),distanceCacl(),aveVeloCacl();
// Variables.
int speed,time,distance,velo,x1,x2,x3,t1,t2,t3; // intended to be DOUBLE
int input,answer; // int so they work w/ switch statement below

main(){
       printMenu();
       scanf("&#37;d",&input);
       system("cls");
       switch (input){
              case 1:
                   speedCacl();
                   getchar();
                   break;
              case 2:
                   timeCacl();
                   getchar();
                   break;
              case 3:
                   distanceCacl();
                   getchar();
                   break;
              case 4:
                   aveVeloCacl();
                   getchar();
                   break;
              case 5:
                   return 0;
              default:
                   printf("Sorry, you put in an incorrect value.\n");
                   getchar();
                   break;
       }
       system("cls");
       printf("Do you want to return to the main menu?\n\t1: y\n\t2: n\n Input: ");
       scanf("%d",&answer);
       getchar();
       switch (answer){
              case 1:
                   system("cls");
                   main();
                   break;
              case 2:
                   printf("Cya!");
                   break;
              default:
                   break;
       }  
       getchar();
       return 0;
}

void printMenu(){ // Could be done w/ one printf, but easier to view >.<
     printf("|-----------------|\n");
     printf("|                 |\n");
     printf("| Physics Program |\n");
     printf("|    Main Menu    |\n");
     printf("|                 |\n");
     printf("|-----------------|\n\n");
     printf("1: Average Speed\n");
     printf("2: Time\n");
     printf("3: Distance\n");
     printf("4: Average Velocity\n");
     printf("5: Quit\n\n");
     printf("Input your selection: ");
     return;
}     
void speedCacl(time,distance){
      printf("\nSpeed\n");
      printf("-----\n\n");
      printf("Input the distance in m: ");
      scanf("%d", &distance);
      printf("Input the time in sec: ");
      scanf("%d", &time);
      speed = distance/time;
      printf("Your speed is: %d\n", speed);
      getchar();
      return;
}

void timeCacl(){
       printf("\nTime\n");
       printf("----\n\n");
       printf("Input the distance in m: ");
       scanf("%d", &distance);
       printf("Input the speed(m/s): ");
       scanf("%d" , &speed);
       time = distance/speed;
       printf("Your time is: %d\n" , time);
       getchar();
       return;
}

void distanceCacl(){
       printf("\nDistance\n");
       printf("--------\n\n");
       printf("Input the speed(m/s): ");
       scanf("%d" , &speed);
       printf("Input the time in seconds: ");
       scanf("%d", &time);
       distance = speed*time;
       printf("Your distance is: %d\n",distance);
       getchar();
       return;
}
void aveVeloCacl(){
       printf("\nAverage Velocity\n");
       printf("----------------\n\n");
       printf("Input the initial(first) time: ");
       scanf("%d",&t1);
       printf("Input the final(second) time: ");
       scanf(" %d",&t2);
       printf("Input distance one: ");
       scanf("%d",&x1);
       printf("Input distance two: ");
       scanf("%d",&x2);
       t3=t2-t1;
       x3=x2-x1;
       velo = x3/t3;
       printf("Your Average Velocity is: %d\n",velo);
       getchar();
       return;
}