ELAB FUEL BANK IN INDIA
Problem Description
In the United States, fuel efficiency for vehicles is normally expressed in miles-pergallon (MPG). In Canada, fuel efficiency is normally expressed in liters-per-hundred kilometers (L/100 km). Use your research skills to determine how to convert from
MPGto L/100 km.
The equivalent Python coding for the above program is as follows:
a=int(input(""));
canli=282.48/a;
print(canli);
Then create a program that reads a value from the user in American units and displays the equivalent fuel efficiency in Canadian units in C language
CODING ARENA::
#include <stdio.h>
int main()
{
float a,b;
scanf("%f",&a);
b=282.48/a;
printf("%.2f",b);
return 0;
}
Test Case 1
Input (stdin)24
Expected Output
11.77
Test Case 2
Input (stdin)25
Expected Output
11.30
No comments:
Post a Comment