I want to pass an average to a function. When I use in the main printf with %d I get the average but if I use %f I got 0.Why? Tk | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

I want to pass an average to a function. When I use in the main printf with %d I get the average but if I use %f I got 0.Why? Tk

Passing average to a function in C

10th Jan 2019, 6:32 PM
Maria
4 ответов
0
Hello Bennett Thanks your answer is very thorough and useful I will check the code .. Though I did try to use Float average ( float ave) on as you suggested ..but I still get errors ...
10th Jan 2019, 8:42 PM
Maria
0
actually ..sorry it does work on this compiler ...i must have mistyped when I tried in the other compiler Thanks ! 🙂
10th Jan 2019, 9:01 PM
Maria
0
thanks this is super useful and much appreciated ☺️
11th Jan 2019, 3:25 PM
Maria