using System;
using System.Text;
namespace MyCompiler {
class Program {
public static void Main(string[] args) {
string str="Pallavi";
int count= str.Length;
Char[] str1= str.ToCharArray();
StringBuilder revstr = new StringBuilder();
for(int i=count-1; i <= count-1; count--)
{
char j = str1[i];
revstr.Append(j);
Console.WriteLine("Reverse Name"+ revstr);
}
Console.WriteLine("Count" + count);
string strinput="Pallavi", revstroutput="";
int length= str.Length-1;
int y=0;
int sameIndexCount=0;
while(length >= 0 && y <= length && sameIndexCount<=1)
{
revstroutput = revstroutput + strinput [y] + strinput[length];
if(sameIndexCount==1)
break;
length--;
y++;
if(y==length)
sameIndexCount++;
}
Console.WriteLine($"Reverse string {revstroutput}");
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: