palindrome for strings and numbers----Can anybody do the
prog?

Answer Posted / sree

#include<stdio.h>
void main
{
int n,t,d,r;
printf("Enter the number:");
scanf("%d",&n);
t=n;
while(n>=1)
{
d=n%10;
r=(r*10)+d;
n=n/10;
}
if(t==r)
printf("Palindrome");
else
printf("Not a palindrome");
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3177


What is pragma c?

603


What is the difference between constant pointer and constant variable?

740


What is a program flowchart?

596


Why is #define used?

786






Is python a c language?

548


What is else if ladder?

603


How many parameters should a function have?

659


What is a constant and types of constants in c?

596


Is javascript based on c?

589


Explain what is the difference between the expression '++a' and 'a++'?

621


What is the data segment that is followed by c?

600


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

1898


What type of function is main ()?

579


Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer

3834