Convert Person Height from Inches to Centimeters

By | June 18, 2019

Today we will write a C language program to convert person height from inches to centimeters. This is a simple formula calculation program. The following is the formula:

centimeters = inches x 2.54.

/*
 C Program to convert person's height 
 from inches to centimeters
 using formula 2.54 * height
*/

#include<stdio.h>

int main()
{
   float inchesHeight, centiHeight;
   printf("Enter Person Height in inches =");
   scanf("%f", &inchesHeight);
   
   centiHeight = inchesHeight * 2.54;
   printf("Height of Person in Centimeters =%.2f", centiHeight);
   return 0;
}

Here is an image explaining the execution of this program:

C program to Convert Person Height from Inches to Centimeters

C program to Convert Person Height from Inches to Centimeters

Leave a Reply

Your email address will not be published. Required fields are marked *