Question: Can someone help fix this code? It is not doing what it is supposed to #include #include //adding float add_userNum(float a, float b, float c)
Can someone help fix this code? It is not doing what it is supposed to
#include
//adding float add_userNum(float a, float b, float c) { float userNum; userNum = a + b + c; return userNum; } //Multiplying float multiply_userNum(float a, float b, float c) { float userNum; userNum = a * b * c; return userNum; } //subtract float subtract_userNum(float a, float b, float c) { float userNum; userNum = -a - b - c; return userNum; } //calling the highest number. float rank_userNum(float a, float b, float c) { if(a >= b && a>= c)
printf(" %f The highest number out of the three was .", a);
else if(b >= a && b>= c)
printf(" %f The highest number out of the three was .", b);
else
printf(" %f The highest number out of the three was .", c); } //prompting user int main() { float a; float b; float c; printf("Enter three float variables: "); scanf("%f",&a); scanf("%f",&a); scanf("%f",&c); float add_userNum = (a,b,c); float multiply_userNum = (a,b,c); float subtract_userNum = (a,b,c); float rank_userNum = (a,b,c);
printf ("The sum of your numbers: %f ", add_userNum); printf ("The multiplication of your numbers: %f ", multiply_userNum); printf ("The subtraction of your numbers: %f ", subtract_userNum); printf ("Your biggest value is: %.1f ", rank_userNum); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
