#Can someone help me with this incomplete code

29 messages · Page 1 of 1 (latest)

primal pollenBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@languid geode

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

rocky sand
#

What are your current thoughts on the problem

languid geode
#

What do you mean thoughts?

#

As in my desired output?

rocky sand
#

What have you tried so far to complete the code, what have you thought about trying

languid geode
#

I'm more so just stuck

rocky sand
#

Help me understand where you are stuck at

languid geode
#

Last part where I added the comments "add code"

rocky sand
#

Well, that brings me back to my earlier question

#

What have you thought about for how to implement that "add code"

#

Or if you have no idea, try to break down the problem and identify what you do not know how to do

languid geode
#

Okay

#

Well for the else if statements

#

one sec

#

{
if (a ) // Checks if 'a' is divisible by 2 without a remainder
{
cout << "yes";
}
else // If there's a remainder, 'a' is not evenly divisible by 2, hence it's odd
{
cout << "no";
}

#

the only part im really stuck at is if (a)

rocky sand
#

ok

#

do you know how to get the remainder in c++

languid geode
#

I've been brainstorming not sure what to put at that part

rocky sand
#

What has your class covered so far

languid geode
#

at basic functions rn

#

Well so far loops, selections, and basic functions

#

{
if (num % 2 == 0) // Checks if 'num' is divisible by 2 without a remainder
{
cout << "yes";
}
else // If there's a remainder, 'a' is not evenly divisible by 2, hence it's odd
{
cout << "no";
}

#

@rocky sand this good?

rocky sand
#

this is good

languid geode
#

Okay thanks

#

!solved

primal pollenBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity