Write a c program to Take distance in Km and time in hours as input and display speed in m/s.
Code:
#include<stdio.h>
main ()
{
float kilometre=0;
float time=0;
float race=0.0;
printf("Enter speed in kilometre: ");
scanf("%d",&kilometre);
printf("Enter time in hours: ");
scanf("%d",&time);
kilometre=kilometre*1000;
time=time*3600;
race=kilometre/time;
printf("speed in m/s is:%f",race);
return 0;
}
Program output:
For more problems click here
No comments:
Post a Comment