Write a C program to accept the height of a person in centimeter and categorize the person according to their height.




#include <stdio.h> 
void main() 
    int a;  
    printf("enter a height in centimeter: "); 
    scanf("%d", &a); 
    if(a == 12){ 
        printf("shortest men!"); 
    } 
    else if(a > 0 && a < 159
    { 
        printf("women!"); 
    } 
    else ifa > 159 && a171
    { 
        printf("men!"); 
    } 
    else  
    {  
        if(a == 243){ 

            printf("tallest men!"); 
        } 
        else { 
            printf("program execute!"); 
        } 
    } 


OUTPUT
Enter a height in centimeter: 243
tallest men!
Enter a height in centimeter: 156
women!

Follow our page for regular updates.

0 Comments