Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Is String a Palindrome
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Boolean flag = palindrome("racecar"); Console.Write(flag); } public static Boolean palindrome(String str) { Boolean flag = false; int i=0; for(int j=str.Length-1; j>0; j--) { if(str[i++]==str[j]) { flag = true; } else { flag = false; break; } } return flag; } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Chris Kasongo Lazarius Mukengeshayi "Entelect BlackJack 21"
HexaStringToFile
test
Prime number
Lesson1
CheckingAccount
Zadanka
fds
PC/DDS Discussion
Random
Please log in to post a comment.