Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a recursive program in'c'to find whether a given five
digit number is a palindrome or not

Answer Posted / nikhil kumar saraf

void main()
{
int no,n,r=0,sum,a,c;
clrscr();
printf("Enter the number:-");
scanf("%d",&no);
n=no;
c=0;
while(n!=0)
{
n=n/10;
c++;
}
if(c!=5)
{
printf("The given number is not a five digit no.");
break;
}
else
{
n=no;
while(n!=0)
{
a=n%10;
r=(r*10)+a;
n=n/10;
}
if(r==no)
printf("The given no. is a pallidrom no.");
else
printf("The given no. is not pallidrom no.");
}
getch();
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is getch() function?

1079


Why c is a mother language?

1052


What is break in c?

1058


Write a program to reverse a linked list in c.

1142


Can include files be nested? How many levels deep can include files be nested?

1178


What is the purpose of ftell?

1095


Explain main function in c?

1094


What are the different types of linkage exist in c?

1039


What are the application of void data type in c?

1200


Is fortran still used today?

1104


What is a sequential access file?

1188


write a program to print largest number of each row of a 2D array

2334


How does #define work?

1088


Write a program to swap two numbers without using a temporary variable?

1142


What is the translation phases used in c language?

1129