#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

How to Split Strings with Regex in Managed C++ Applications?

0 Answers   Microsoft,


Given 1 to n distinct random number of which n+1th element was duplicated. How do find the duplicate element and explain the time complexity of the algorithm.

0 Answers   Microsoft, NetApp,


what is virtual constroctor ? give an exam for it?-(parimal dhimmar)

2 Answers  


Coin Problem You are given 9 gold coins that look identical. One is counterfeit and weighs a bit greater than the others, but the difference is very small that only a balance scale can tell it from the real one. You have a balance scale that costs 25 USD per weighing. Give an algorithm that finds the counterfeit coin with as little weighting as possible. Of primary importance is that your algorithm is correct; of secondary importance is that your algorithm truly uses the minimum number of weightings possible. HINT: THE BEST ALGORITHM USES ONLY 2 WEIGHINGS!!!

1 Answers   Motorola, Qatar University,


i don't know about working of nested for loop can any one help me

0 Answers  






write a proram using exceptional handling create a error & display the message "THERE IS AN ERROR?... PLEASE RECTIFY"?

1 Answers  


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

0 Answers   HCL, SRCASW,


#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 code for the multiplication of COMPLEX numbers?

0 Answers   IBM,


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

0 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,


Write a program using two-dimensional arrays that determines the highest and lowest of the 12 input values. Example: Enter 12 numbers: 13 15 20 13 35 40 16 18 20 18 20 14 highest: 40 lowest: 13

1 Answers  


Categories