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
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
What is pragma c?
What is the difference between constant pointer and constant variable?
What is a program flowchart?
Why is #define used?
Is python a c language?
What is else if ladder?
How many parameters should a function have?
What is a constant and types of constants in c?
Is javascript based on c?
Explain what is the difference between the expression '++a' and 'a++'?
What is the data segment that is followed by c?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What type of function is main ()?
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