Different output is coming

In the lecture, Ma’am has assiged the value of num2 = sum. But, I have assigned num2 = num1 + num2, because sum = num1 + num2. But, a different output is coming. Why?

@saijaltripathy_e79096f8f1ec20e3 send me your code.

@saijaltripathy_e79096f8f1ec20e3 First of all asking your doubt from the doubt portal is mandatory otherwise I will not be able to see the doubts. Don’t directly use discuss.codingblocks.
Now coming to your question : put this line num2 = num1 + num2; before num1 = num2; bcoz if you put it after num1 = num2 then num1 is updated and you will get get wrong answer.

Ok, then how will the code be correct if I write the same code by just changing num2=sum?

And as you told me, that I can attach images by dragging them into the doubt box. But, it’s not working. I even tried to copy paste, but all in vain.