You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
programming-examples/c/Basic/C Program to Accept the Hei...

21 lines
582 B
C

/*
* C program to accept the height of a person in centimeter and
* categorize the person based on height as taller, dwarf and
* average height person
*/
#include <stdio.h>
void main()
{
float height;
printf("Enter the Height (in centimetres) \n");
scanf("%f", &height);
if (height < 150.0)
printf("Dwarf \n");
else if ((height >= 150.0) && (height <= 165.0))
printf(" Average Height \n");
else if ((height >= 165.0) && (height <= 195.0))
printf("Taller \n");
else
printf("Abnormal height \n");
}