How to make a Program to find whether a number is palindrome

Progarm should end when user want it to stop..can't use ARRAY or S

Page 1 of 1

2 Replies - 1120 Views - Last Post: 22 January 2009 - 11:46 AM Rate Topic: -----

#1 Karankang007  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-January 09

How to make a Program to find whether a number is palindrome

Post icon  Posted 20 January 2009 - 11:27 PM

Plz do the promgram...if any one have source code.

DON"t use array or string in it...
Is This A Good Question/Topic? 0
  • +

Replies To: How to make a Program to find whether a number is palindrome

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5382
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: How to make a Program to find whether a number is palindrome

Posted 20 January 2009 - 11:45 PM

View PostKarankang007, on 21 Jan, 2009 - 12:27 AM, said:

Plz do the promgram...



Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
Was This Post Helpful? 0
  • +
  • -

#3 superchiku  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 9
  • Joined: 22-January 09

Re: How to make a Program to find whether a number is palindrome

Posted 22 January 2009 - 11:46 AM

View PostKarankang007, on 20 Jan, 2009 - 10:27 PM, said:

Plz do the promgram...if any one have source code.

DON"t use array or string in it...



1st of all any no is a palindrome if it gives the same no when it is read in reverse


here is my code
	   
# include<stdio.h>
# include<conio.h>

 void main()
  {
	int n,j,d;
	j=0;
	printf("enter a no");
	scanf("%d",&n);
	d=n;
	while(d!=0)
	  {
		j=j+(d%10);
		d=d/10;
	  }
	if(j==n)
	printf("the no is palindrome");
	else
	printf("the no is not a palindrome");
	getch();
  }



hope this piece of code works
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1