Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need help with verbal discription
This is my first assignment
I have no idea how to do it

https://i.stack.imgur.com/Wv6zu.png[^]

What I have tried:

I don't know how to do it myself and I have to do it by tomorrow
Posted
Updated 14-Sep-22 12:28pm

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by indenting the code correctly so it is readable before you go any further. Then look at each line and check back in your course notes. This isn't complicated - just bad code - so it shouldn't take you more than half an hour or so, even if you are nearly a complete beginner.
 
Share this answer
 
First of all, it makes sense to type the code or OCR it into text.
The include file <iostream.h> indicates that a non-standard or outdated compiler was used. The variable o is not used, which usually causes a warning. The condition (a>0 && a%2 == 0) plays a central role and is met for a=6, 2 and 4.
The final output would be 483.
If you want to investigate it yourself I recommend to compile the source code and look at it line by line with a debugger. Alternatively, you can of course look at the code line by line. However, since the code is written very unclearly, this becomes more difficult.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900