reverse the array vinoth
Loading
reverse the array vinoth
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pushpendra ShuklaPosted Jul 28, 2022, 7:09 AM
Rijwan AnsariPosted Jul 27, 2022, 2:16 PM
Satya KarkiPosted Jul 27, 2022, 9:32 AM
Rajanikant HawaldarPosted Jul 27, 2022, 7:32 AM
// Inbuilt Method Array.Reverse Method
string stringInput="vinoth";
char[] charArray = stringInput.ToCharArray(); Array.Reverse(charArray);
Console.WriteLine(new string(charArray));
Rajanikant HawaldarPosted Jul 27, 2022, 7:29 AM
string str = "vinoth", reverse = "";
int Length = 0;
//Calculate length of string str
Length = str.Length - 1;
while(Length>=0)
{
reverse = reverse + str[Length]; Length--;
}
//Displaying the reverse word Console.WriteLine("Reverse word is {0}",reverse); Console.ReadLine();