Compute the average kids per family. Note that the integers should be type cast to doubles.
#include <stdio.h>
int main(void) {
int numKidsA;
int numKidsB;
int numKidsC;
int numFamilies;
double avgKids;
numKidsA = 1;
numKidsB = 4;
numKidsC = 5;
numFamilies = 3;
avgKids = (double) (numKidsA + numKidsB + numKidsC) / numFamilies;
printf("Average kids per family: %lf\n", avgKids);
return 0;
}
Use left/right arrows to navigate the slideshow or swipe left/right if using a mobile device