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
What is null in c?
What are the similarities between c and c++?
Can the “if” function be used in comparing strings?
Explain what is dynamic data structure?
Is c language still used?
What are the general description for loop statement and available loop types in c?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Can a pointer be static?
Write a program to print fibonacci series without using recursion?
Do you know pointer in c?
What is sorting in c plus plus?
Explain what is meant by high-order and low-order bytes?
What is a keyword?
What does the message "automatic aggregate intialization is an ansi feature" mean?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.