From ba93a5dca5f93fe7b5761c251037d4f1860f9a43 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Sun, 14 Apr 2024 04:59:29 +0000 Subject: Sat, Apr 13, 2024, 9:59 PM -07:00 --- wk5/pset/inheritance/inheritance.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wk5/pset/inheritance/inheritance.c b/wk5/pset/inheritance/inheritance.c index d973b67..7e5916a 100644 --- a/wk5/pset/inheritance/inheritance.c +++ b/wk5/pset/inheritance/inheritance.c @@ -1,10 +1,10 @@ // Simulate genetic inheritance of blood type +#include #include #include #include #include -#include // Each person has two parents and two alleles typedef struct person @@ -112,11 +112,13 @@ void print_family(person *p, int generation) // Print person if (generation == 0) { - printf("Child (Generation %i): blood type %c%c\n", generation, p->alleles[0], p->alleles[1]); + printf("Child (Generation %i): blood type %c%c\n", generation, p->alleles[0], + p->alleles[1]); } else if (generation == 1) { - printf("Parent (Generation %i): blood type %c%c\n", generation, p->alleles[0], p->alleles[1]); + printf("Parent (Generation %i): blood type %c%c\n", generation, p->alleles[0], + p->alleles[1]); } else { @@ -124,7 +126,8 @@ void print_family(person *p, int generation) { printf("Great-"); } - printf("Grandparent (Generation %i): blood type %c%c\n", generation, p->alleles[0], p->alleles[1]); + printf("Grandparent (Generation %i): blood type %c%c\n", generation, p->alleles[0], + p->alleles[1]); } // Print parents of current generation -- cgit v1.2.3