TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vasanth krishna
NA
44
56.1k
not all codepaths return a value
Aug 6 2013 10:35 AM
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);
}
}
Reply
Answers (
2
)
not all codepaths return a value
c# palindrome program