[Solved] I can not take result of my function [closed]


I suggest using a debugger and carefully crafting your code in small chunks so that it grows into what you finally need. the first error I spotted is that you have an invalid countdown loop

for (int j = m ; j <= 1; j--)

should read

for (int j = m ; j >= 1; j--)

i.e. m is assumed to be greater than 1 so in your code th loop will never execute.

the second thing I spotted is that you are using the value d as a multiplier in your tri function but you set d in a loop to (d – d) * something else – can you spot the obvious error?

Didn’t go searching for anything else but I strongly suggest you name you variables something meaningful “a, b, c, d …” make bug-finding far more difficult than it should be.

0

solved I can not take result of my function [closed]