Read your height in inches and then displays your height in centimeters. - C Operator

C examples for Operator:Arithmetic Operator

Introduction

There are 2.54 centimeters to the inch.

Demo Code

#include <stdio.h>

int main(void)
{
  float CM_PER_INCH = 2.54;
  float height;//ww w.  j  a  v  a 2  s  . c om

  printf("Enter your height (in inches): ");
  scanf("%f", &height);
  printf("You are %f centimeters tall.\n", height * CM_PER_INCH);

  return 0;
}

Result


Related Tutorials