You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int main() {
int father_height, mother_height;
char gender;
float predicted_height;
printf("Enter the height of the father (in inches): ");
scanf("%d", &father_height);
printf("Enter the height of the mother (in inches): ");
scanf("%d", &mother_height);
printf("Enter the gender of the child (M/F): ");
scanf(" %c", &gender);
predicted_height = (father_height + mother_height) / 2.0;
if (gender == 'M') {
predicted_height += 2.5;
} else if (gender == 'F') {
predicted_height -= 2.5;
} else {
printf("Invalid gender input\n");
return 1;
}
printf("Predicted height of the child: %.2f inches\n", predicted_height);
return 0;
}
The text was updated successfully, but these errors were encountered:
#include <stdio.h>
int main() {
int father_height, mother_height;
char gender;
float predicted_height;
}
The text was updated successfully, but these errors were encountered: