Borland use 5.02 for a college job ... and for some reason the program is not able to assign variable values in other variables to simple mathematical functions.
This is my code:
#include <stdio.h>
#include <conio.h>
main()
{
int m, s, cs, mt,h,km;
float t1,t2,s2, v;
printf("Introduzca minutos: "); scanf("%i",&m);
printf("Introduzca segundos: "); scanf("%i",&s);
printf("Introduzca centecimas de segundos: "); scanf("%i",&cs);
printf("Introduzca metros: "); scanf("%i",&mt);
if(m<60 && s<60 && cs<100 || 0>m && 0>s && 0>cs && 0>mt)
{
t1=m*60;
t2=cs/100;
s2=t1+t2+s;
h=(s2/60)/60;
km=mt/1000;
v=h/km;
printf("Su velocidad fue de: %8.2f kmh", (v));
}
else
{
printf("Error.");
}
getch();
}