using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Biggestvalueinarray
{
class Class1
{
static void Main()
{
string str = "Mahesh Babu";
char[] arr = str.ToCharArray();
string str1="",str2="";
for (int i = arr.Length-1; i >= 0; i--)
{
str1 = str1 + arr[i].ToString ();
}
Console.WriteLine(str1);
char[] arr1 = str1.ToCharArray();
int len=str1.Length ;
for (int i =0; i<arr1.Length ;i+=2)
{
str2 = str2 + arr1[i].ToString();
}
Console.WriteLine(str2);
Console.Read();
}
}
}
No comments:
Post a Comment