Computer Science, asked by Anonymous, 1 year ago

Explain the working of C++ Program of Sum of Factors.
.
Program in the Attachment!

Attachments:

Answers

Answered by Anonymous
0

Can I specify the lines of the program to be explained!


Anonymous: And Sum is saved to 1
Anonymous: The loop is started again and this time X becomes 2
Anonymous: And in the third looping X become 3 and it is saved with Sum
Anonymous: Sum becomes 4
Anonymous: The loop starts again
Anonymous: X become 4
Anonymous: The first if condition becomes true
Anonymous: break statement is executed and the program control goes out of the loop
Anonymous: And last it prints Sum of the factorial is 4 (In a new line due to \n )
Anonymous: Hope it helps. IF u have any further dobute add me as a friend and message me.
Similar questions