0
C language
I want to write a code which calculates the variance of 5 numbers I wrote this but it doesn’t work Do you know what is the problem?! https://code.sololearn.com/cZPq6Pu8hfj9/?ref=app
5 Antworten
+ 1
In function f(), you are not declared values for a, b, c, d, e.
So it take some garbage values.
First need to give values to those.
And in main function, f(), functions variables are completely different. There scope is local. So it is available outside of their functions...
If you make those variables as global, then variables are available through out program in all functions..
0
put this above int main to be global :
float a,b,c,d,e,x,answer
remove this line in the f function.:
float a,b,c,d,e
0
float a,b,c,d,e are not initialized. They are holding garbage value which result undefined behavior.
Put the input numbers into the function.
0
0
CarrieForle would you help me with my last question?!😢