Answer to Question #47533 in C for Michael Ross

Question #47533
Write a c program that converts feet to inches and centimeters to meters. Thanks
1
Expert's answer
2014-10-06T14:09:24-0400
#include <stdio.h>
#include <stdlib.h>
int main()
{
//1 foot = 12 inch
int f,in;
float cm,m;
printf("Enter feet value: ");
scanf("%d",&f);
in = f*12; //foot to inches
printf("in %d foot: %d inches ", f, in);
printf("\n\nEnter centimetre value: ");
scanf("%f",&cm);
m = cm/100; //cm to meters
printf("in %4.2f cm: %4.2f meters\n ", cm ,m);
system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS