write program in C# for palindrome? (aug 2009)
write program in C3 for generating below output?(aug 2009)
#
# #
# # #
# # # #

Answers were Sorted based on User's Feedback



write program in C# for palindrome? (aug 2009) write program in C3 for generating below output?(aug..

Answer / elan

string sName = "elan";
char[] aName = sName.ToCharArray();
Array.Reverse(aName);
string sReversedName = new string(aName);
if (sName == sReversedName)
{
MessageBox.Show("it is palindrome");
}
else
{
MessageBox.Show("it is not palindrome");
}

Is This Answer Correct ?    25 Yes 10 No

write program in C# for palindrome? (aug 2009) write program in C3 for generating below output?(aug..

Answer / kanan

int k = 3;

for (int i = 1; i <= 4; i++)
{
for (int j = k; j > 0; j--)
{
Response.Write("&nbsp;&nbsp;");
}
for (int x = 0; x < i; x++)
{
Response.Write("#");
Response.Write("&nbsp;&nbsp;");
}
k--;
Response.Write("<br/>");

Is This Answer Correct ?    15 Yes 1 No

write program in C# for palindrome? (aug 2009) write program in C3 for generating below output?(aug..

Answer / elan

Hi Kanan,

Your code will work, however it was very standard one and
in interview, interviewer will expect candidate to provide
answers with regards to Array. In that point of view we
have provide answers using array. It will express our
knowledge in Array to employer.

I hope my answer make sence. Please provide your comments
if you have anything.

Is This Answer Correct ?    6 Yes 1 No

write program in C# for palindrome? (aug 2009) write program in C3 for generating below output?(aug..

Answer / elan

Hi Kannan,

Also my reply is for the following question.

write program in C# for palindrome? (aug 2009)

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What kind of the information stored inside the assembly?

0 Answers   CitiusTech,


What is a type c#?

0 Answers  


What is a nullreferenceexception?

0 Answers  


Does C# support multiple inheritance?

3 Answers   IBM, Siebel Systems, Visual Soft,


What are the ways in which client can create object on server in cao model?

0 Answers  






What does the keyword virtual mean in the method definition?

3 Answers   Ipog Software, Satyam, Visual Soft,


How do you declare a method in c#?

0 Answers  


Can you allow class to be inherited, but prevent the method from being over-ridden?

1 Answers  


Can we use "this" command within a static method?

0 Answers  


Why do we need generics in c#?

0 Answers  


Can we inherit a private class in chsarp? how? explain(with code) ?

4 Answers   Techno Labs,


What are the advantages of generics in c#?

0 Answers  


Categories