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


Please Help Members By Posting Answers For Below Questions

What are global variables and how do you declare them?

615


Difference between exit() and _exit() function?

653


how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

1504


What are external variables in c?

543


Why is it that not all header files are declared in every C program?

676






Tell us something about keyword 'auto'.

659


What is character set?

681


Who is the founder of c language?

678


What is non linear data structure in c?

567


hi, which software companys will take,if d candidate's % is jst 55%?

1660


Why can’t constant values be used to define an array’s initial size?

828


What is getch () for?

672


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

754


Why should I prototype a function?

630


What is call by reference in functions?

560