Km to Mile Convertor

Initialize of Input








Step of Execution

#include <stdio.h>
int main()
{
int n;
float t,mil,km;
printf("Enter a Number which case to run:");
scanf("%d", &n);
switch(n){;
case 1:
printf("Enter a distance in km ");
scanf("%f", &t);
mil=t*0.6213;
break;
case 2:
printf("Enter a distance in Miles: ");
scanf("%f", &t);
km=t*1.6093;
break;
}
return 0;
}

Code Output