write a program of palindrome(madam=madam) using pointer?
Answer Posted / ravinder singh rawat
#include<conio.h>
#include<stdio.h>
void main()
{ char *a,*count,s[11];
int i ;
printf("\n:enter string for Palindrome test\t");
scanf("%s",&s);
i= strlen(s);
a=(char *)malloc(i*sizeof(char));
a=&s[0];
count=&s[i-1];
while((*(a++)==*(count--)) && i>=1)
{ i--; }
if(i==0) { printf("\n%s is a palin",s);}
else { printf("\n%s is not palin",s);}
getch();
}
| Is This Answer Correct ? | 39 Yes | 7 No |
Post New Answer View All Answers
What is the meaning of c in c language?
please give me some tips for the placement in the TCS.
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
How can a process change an environment variable in its caller?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
What does %d do in c?
What is the difference between exit() and _exit() function in c?
what type of questions arrive in interview over c programming?
Who invented bcpl language?
What is string function in c?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Why & is used in c?
What does 3 periods mean in texting?
What is time complexity c?
Explain the array representation of a binary tree in C.