C Program Miles to Kilometers

By | March 6, 2020

C Program Miles to Kilometers

C Source Code / C Program Miles to Kilometers

#include <stdio.h>
int main()
{
 float miles, kilometers;

  printf("Enter distance in Miles=");
  scanf("%f", &miles);

  kilometers = miles * 1.609;

  printf("%.2f Miles are equal to %.2f kilometers", miles,kilometers);

  return 0;
}

Output

Enter distance in Miles=65
65.00 Miles are equal to 104.58 kilometers
Press Enter to return to Quincy…

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *