Read your height in inches and your name, and then displays the information - C Language Basics

C examples for Language Basics:Hello World

Description

Read your height in inches and your name, and then displays the information

Demo Code

#include <stdio.h>

int main(void)
{
  const float INCHES_PER_FEET = 12;
  float height;/*w ww . j av a2s.com*/
  char name[40];

  printf("What is your name?: ");
  scanf("%s", name);
  printf("What is your height in inches?: ");
  scanf("%f", &height);
  printf("%s, you are %.3f feet tall.\n", name, height / INCHES_PER_FEET);

  return 0;
}

Related Tutorials