hello r/ what can i do to this code so it multiplies the numbers in printf
i can't find any source about multiplying there is only summing and taking average.
>>313033
i havent coded in c in forever and i dont speak german im guessing. but you should look up the printf syntax because it should be as simple as normal mulitplication.
>>313033
The line "top += va_arg(ap, int);" is doing the summing.
Step 1 would be to change to += to *= to multiply the by next value from the argument list.
Step 2 is to realize that with top set to zero at its declaration, every call will return zero, so initialize it to one instead.
Step 0 would be to ask yourself how you wound up working with variable argument lists before you learned the basic math operators, because that's ass-backwards.
>>313058
sooo there is the problem i did it but it always gave zero output because top was zero thank you anon i will try it.
>>313058
IT IS ALIVE!!! IT IS ALIVE!
thank you senpai :3333333
>>313058
>would be to ask yourself how you wound up working with variable argument lists before you learned the basic math operators, because that's ass-backwards.
this so much
I'm a bit astounded actually