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

Answer Posted / subbu

/*some corrections to above solution*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,temp;
int s=0;

printf("enter the number");
scanf("%d",&n);
temp=n;
while(temp>0)
{
r=temp%10;
s=s*10+r;
temp=temp/10;
}
if(n==s)
printf("number is pallindrome");
else
printf("not pallindrome");
getch();
}

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

2001


Can a program have two main functions?

573


What is the acronym for ansi?

632


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

658


hi send me sample aptitude papers of cts?

1655






Which type of language is c?

654


What is a ternary operator in c?

655


What is volatile variable in c?

659


formula to convert 2500mmh2o into m3/hr

499


Why doesnt the call scanf work?

676


What is external variable in c?

614


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

1849


Can we declare function inside main?

571


What are formal parameters?

663


What are register variables? What are the advantage of using register variables?

688