O.k My teacher game me a take home exam which will be submitted on monday..... and also I have to defend what I composed so I will ask you many questions so that I will understand this program..... my teacher said Never use C... do it in your own ideas....
Problem 1: Write a program to read in a distance expressed in kilometers and output the distance expressed in miles. One kilometer is equal to 0.62137 miles.
Example Ouput:
Enter Value in Kilometers:4
Value in Mile: 2.48548
Here is my program:
#include<stdio.h>
main()
{
int a;
float b=0.62137,c;
printf("Enter Value in Kilometers:");
scanf("%d",&a);
c=a*b;
printf("Value in miles:%f",c);
getch();
return 0;
}
Is this right???