I am having trouble, I have to show an average of four numbers you input. The numbers have to shown as an int and as a float. This is what I have so far:
#include <stdio.h>
int main()
{
float moo, poo, koo, loo;
float foo;
int hoo;
printf("Enter 4 numbers to be averaged: ");
scanf("%f %f %f %f", &moo, &poo, &koo, &loo);
foo = (moo + poo + koo + loo) /4;
hoo = foo;
printf("Your average as a Float: %f\n", foo);
printf("Your average as an Integer: %d\n", hoo);
return 0;
}
I get and error but it seems to run fine, what do you guys think of the code?
#include <stdio.h>
int main()
{
float moo, poo, koo, loo;
float foo;
int hoo;
printf("Enter 4 numbers to be averaged: ");
scanf("%f %f %f %f", &moo, &poo, &koo, &loo);
foo = (moo + poo + koo + loo) /4;
hoo = foo;
printf("Your average as a Float: %f\n", foo);
printf("Your average as an Integer: %d\n", hoo);
return 0;
}
I get and error but it seems to run fine, what do you guys think of the code?
