Answer Posted / manindra agrawal
using System;
using System.Collections.Generic;
using System.Text;
class plaindrome
{
public static void Main()
{
string str1="";
int n,i=0;
int status=0;
System.Console.WriteLine("Enter the value...");
str1=Console.ReadLine(); // accept the value from the user
int len;
len=str1.Length; //calculating Lenght of the string
n=len;
while(i<n/2)
{
if(str1[i]==str1[n-1])
{
status=1;
i++;
n--;
}
else
status=0;
break;
}
if(status==1)
System.Console.WriteLine("Given string is plaindrom");
else
System.Console.WriteLine("Given String is not Plaindrome");
}
}
| Is This Answer Correct ? | 7 Yes | 5 No |
Post New Answer View All Answers
How can I create image pieces/sub image?
Can struct inherit from class c#?
Is java better than c sharp?
How is lazy loading achieved?
Difference between directcast and ctype.
List down the differences between “dispose” and “finalize” methods in c#.
Is it not possible to store a boolean value as a variable?
Why do we Need of static class in c#?
Are cao stateful in nature?
What is difference between internal and protected internal in c#?
Describe the parts of assembly.
What is a generic c#?
Why do we need properties in c#?
What is cshtml extension?
Can constructor be overloaded in c#?