Where is wrong in this code? | SoloLearn: Learn to code for FREE!

+6

Where is wrong in this code?

I get 3 out of 6 in code coach https://code.sololearn.com/cEk5CxqIUr9M/?ref=app

c++

11/29/2020 7:39:10 AM

🤴🌹Cute Princess 🌹💐

7 Answers

New Answer

+4

1. In function Ispalindrome() there is no need to statement scanf (no need to enter any number again) 2. And there must be return statement of function . That returns true or false. i made some chnges in your code. i hope this will help you. https://code.sololearn.com/c6s11CkxV6BH/?ref=app

+5

Mohammed Qadir khan Azhagesanヾ(˙❥˙) BEGGINER Thank you so much

+4

You not using int x parameter value, and not returning Boolean value beacuse your return type is bool. So i am added one variable "temp" And storing value of x and comparing that value to reverse number Value. Otherwise all things are right 👍👍. All the Best 👍. https://code.sololearn.com/c4VnEat6b1S2/?ref=app

+4

Most Welcome🤴🌹Cute Princess 🌹💐 .

+2

1. Remove line 7 and 8 after that and assign num=x 2. After the while loop add if statement to check rev is equal to x .If yes return true else return false. And int n not required inside function. For explanation see BEGGINER answers

0

Your function is type of bool it's take only true and false valu not any int You need to change that either wish try to simple way ☺️

0

ممكن مساعده