Sunday, 15 December 2013

C Program to Accept the Height of a Person & Categorize as Taller, Dwarf & Average

#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");
}

Output

 Enter  the Height  (  in  centimetres ) 
 165 
 Average Height
   
Enter  the Height  (  in  centimetres ) 
 140 
Dwarf
   
Enter  the Height  (  in  centimetres ) 
 190 
Taller

For More Details Please Visit Ictjobs.info

No comments: