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
Why static is used in c?
What are the uses of null pointers?
Can we compile a program without main() function?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Explain what is wrong with this program statement?
What is the use of bit field?
What is FIFO?
What is a rvalue?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
Why c is known as a mother language?
What is a constant and types of constants in c?
What is the purpose of realloc()?
What are enumerated types?
C program to find all possible outcomes of a dice?