Write a program that converts centimeters to inches Your pro

Write a program that converts centimeters to inches. Your program should prompt the user to enter a height in centimeters, convert it to inches, and print the result to the console. Note that 1 inch = 2.54 centimeters. Below is a sample run:

Please enter your height in centimeters:

175.00 centimeters is equivalent to 68.90 inches

Solution

#include<studio.h>

#include<conio.h>

void main()

{

int height,inch;

printf(\"Please enter you height in centimeters:\");

scanf(\"%d\",&height);

inch=height*0.394;

printf(\"centimeters is equivalent to %d\",inch);

getch();

}

Write a program that converts centimeters to inches. Your program should prompt the user to enter a height in centimeters, convert it to inches, and print the r

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site