C Language program to convert kilometers to miles

Views: 384   

Following program shows you how to convert kilometers to miles.
In this program we get kilometers from user, once we get those we need to divide with 1.6 so that we get in miles

#include <stdio.h>

int main(void) {
    float kilometers;

    printf("Please enter kilometers:");
    scanf("%f", &kilometers);

    float miles = kilometers / 1.6;

    printf("%f Miles", miles);
}

Output:

Please enter kilometers: 20
12.500000 Miles
On By