I need help with this http://codepad.org/FNUci22s
I am posting the ling of code pad because it has a way to execute it, so long story short. I use two different functions seno, sen (both for sin). When using the printf and adressing both to compare results I get from the seno function the correct result(sin(45)=0.70710) but the moment I remove the other function from the printf i get "nan". Funcitons dont depend from each other.
xikhari.some1behindu
0
Newbie Poster
Recommended Answers
Jump to PostThe reason your program is behaving so unpredictably is because you are not initializing the variable
res
in yourseno()
function, nor are you initializingsin1
in yoursen()
function. Because you are using the values of these variables before initializing them, you are invoking undefined behavior. I could go …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.