Program to accept the height of a person in centimeter and categorize the person according to their height using the following information

 


Height category
0-1 m drawf
1 - 1.5 m Normal
>1.5m Tall
C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int h;
    printf("Enter your Height cm:");
    scanf("%d",&h);
    if(h<100 && h>0)
        printf("Drawf");
    else if(h<150 && h>100)
        printf("Normal");
    else if(h<0)
        printf("Height cannot be negative");
    else
        printf("Tall");
}

0 Comments:

Post a Comment