5. distance conversion:
Convert a distance from miles to kilometers .there are 5280
feets per mile,12 inches per foot .2.54 centimeters per
inch and 100000centimeters per kilometer
Answer Posted / gayathri
include<stdio.h>
void main()
{
int miles;
double inch,feet;
long cm,km;
printf("Enter how many miles");
scanf("%d",&miles);
feet=5280*miles;
inch=feet*12;
cm=inch*2.54;
km=(cm/100000);
printf("Distance in KM:%lf"+km);
}
I did not compile the program,i wrote it directly
If there are any errors please specify........
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Can you please explain the difference between syntax vs logical error?
Mention four important string handling functions in c languages .
Is python a c language?
Why do we use stdio h and conio h?
What is c definition?
What are identifiers c?
Why doesnt this code work?
What are the features of the c language?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What is difference between class and structure?
What does the file stdio.h contain?
What is a protocol in c?
Can you please explain the difference between exit() and _exit() function?
List some of the static data structures in C?
Are the variables argc and argv are local to main?