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
Should I learn c before c++?
Explain the difference between the local variable and global variable in c?
How do you define CONSTANT in C?
What are header files and explain what are its uses in c programming?
What are the 4 types of organizational structures?
What is a keyword?
What is chain pointer in c?
Is null equal to 0 in sql?
What is a union?
How do I get a null pointer in my programs?
how to build a exercise findig min number of e heap with list imlemented?
What is meant by preprocessor in c?
Explain how can you be sure that a program follows the ansi c standard?
Is calloc better than malloc?
When should the register modifier be used? Does it really help?