#include<stdio.h>
#include<conio.h>
void main()
{
char str[10];
int,a,x,sw=0;
clrscr();
printf("Enter a string:");
gets(str);
for(x=0;x<=a;a++);
for(x=0;x<=a;x++)
{
if(str[x]==str[a-1-x])
{
sw=1;
}
else
sw=0;
}
if(sw==10
printf("The entered string is palindrome:");
else
printf("The entered string is not a palindrome:);
}
getch();
}

wht would be the explanation with this written code???

Answers were Sorted based on User's Feedback



#include<stdio.h> #include<conio.h> void main() { char str[10]; int,a,x,sw=0; clrs..

Answer / pushker

this is reverse a string u can check by putting on a value
that..u make this by simple way..
contact me:
yadav.pushker@gmail.com

Is This Answer Correct ?    5 Yes 0 No

#include<stdio.h> #include<conio.h> void main() { char str[10]; int,a,x,sw=0; clrs..

Answer / narmadha

#include<stdio.h>
#include<conio.h>
void main()
{
char str[10];
int a,x,sw=0;
clrscr();
printf("Enter a string:");
getch(str);
for(x=0;x<=a;a++)
for(x=0;x<=a;x++)
{
if(str[x]==str[a-1-x])
{
sw=1;
}
else
sw=0;
}
if(sw==10)
printf("The entered string is palindrome:");
else
printf("The entered string is not a palindrome:);
}
getch();
}

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More C++ Code Interview Questions

write a function – oriented program that calculates the sum of the squares from 1 to n. thus, if the input is 3, the output is 14

3 Answers  


Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.

5 Answers   ADP, Amazon, HCL, IBM, Infosys, Satyam, TCS, Vimukti Technologies,


write a program that can locate elements in array.

1 Answers  


can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

0 Answers  


can we declare an object of a class in another class?(assume both class as public classes)

1 Answers   Microsoft,






Here's the programm code: int magic(int a, int b) { return b == 0 ? a : magic(b, a % b); } int main() { int a, b; scanf("%d%d", &a, &b); printf("%d\n", magic(a, b)); return 0; } on input stream we have integers 4, 45 What's the output integer? How many times will be initiated "magic" function?

1 Answers  


write a program that accepts a number and outputs its equivalent in words. take note that the maximum input is 3000

1 Answers   Alvin,


3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...

0 Answers  


#include<stdio.h> #include<conio.h> void main() { char str[10]; int,a,x,sw=0; clrscr(); printf("Enter a string:"); gets(str); for(x=0;x<=a;a++); for(x=0;x<=a;x++) { if(str[x]==str[a-1-x]) { sw=1; } else sw=0; } if(sw==10 printf("The entered string is palindrome:"); else printf("The entered string is not a palindrome:); } getch(); } wht would be the explanation with this written code???

2 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

0 Answers   iGate,


what is the diffrence between ++x , x++ pleaaaaase ???

7 Answers  


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

0 Answers   Jomo Kenyatta University,


Categories