Console Application-Reverse the given string.
This code will show you that how you can reverse the given user's string using console application.
CSS
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
MicrosoftInternetExplorer4
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
public void Main()
{
int i = 0;
int l = 0;
int j = 0;
string[] n = new
string[11];
Console.WriteLine("Enter
the String For Reverse:=>");
n[i] =
Console.ReadLine();
i = 0;
for (i = 0; i
<= n[i] == " "; i++) {
l = l + 1;
}
for (i = l - 1; i
>= 0; i += -1) {
Console.WriteLine(n[i]);
}
Console.ReadLine();
}
|
Join the conversation! Your thoughts help the community grow.