Question #214620

Write a C program to print weight and height of a person using typedef.


Expert's answer

#include <stdio.h>  
int main()  
{  
    typedef float f;  
    f height, weight;
    
    printf("Enter your height: ");
    scanf("%f",&height);
    
    printf("Enter your weight: ");
    scanf("%f",&weight);
    
    printf("Height is: %f",height);  
    printf("\nWeight is: %f",weight);  
    
    return 0;  
}  
LATEST TUTORIALS
APPROVED BY CLIENTS