Write a C program to print weight and height of a person using typedef.
Input : Weight: 50.5
Height: 7.2
Output : Weight: 50.5
Height: 7.2
#include <stdio.h>
int main()
{
typedef float typedefFloat;
typedefFloat height, weight;
printf("Enter your weight: ");
scanf("%f",&weight);
printf("Enter your height: ");
scanf("%f",&height);
printf("Weight is: %.1f",weight);
printf("\nHeight is: %.1f",height);
scanf("%f",&height);
return 0;
}
Comments
Leave a comment