#include int main () { float s1,t1,s2,t2; printf("Enter the speed 1: "); scanf("%f",&s1); printf("Enter the time 1: "); scanf("%f",&t1); printf("Enter the speed 2: "); scanf("%f",&s2); printf("Enter the time 2: "); scanf("%f",&t2); float avgSpeed = (s1 * t1 + s2 *t2)/(t1+t2); printf(" The avg speed is : %.02f\n",avgSpeed); // %.02f is for limiting the precision to 2 decimal point. }