Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
not all codepaths return a value
vasanth krishna
11y
825
1
Reply
Error :
"not all code path return a value"
what's the problem in this program..the program is to find the given number is a
palindrome or not
class Program
{
static void Main(string[] args)
{
int number;
number = Convert.ToInt32(Console.ReadLine());
int rev = rev1(number);
Console.WriteLine(rev);
if (rev == number)
Console.WriteLine("is a palandrome");
else
Console.WriteLine("not a palandrome");
Console.ReadLine();
}
private static int rev1(int number)
{
int sum = 0;
if(number==0)
{
int j = number % 10;
sum = sum * 10 + j;
int c = sum;
rev1(number / 10);
}
}
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
not all codepaths return a value
c# palindrome program