Fruit bowl problem
Iâm solving this problem in c++, and thereâs something that i donât get. It says you have an even amount of fruit, half apples, and half bananas. When coding, i tried to add an âifâ function, so that if the amount of fruit was odd, you couldnât solve it because technically you canât have an odd number of fruit in this problem, and in case the hypothetical user of this program tried to input an odd number, the program would tell them that. But it gave me trouble when solving, said three of the 5 answers were wrong (possibly because they had used odd numbers and my program was just saying it couldnât be). However when i took that condition out, the program worked fine. Does that mean we have to overlook the info given in the problem?