We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Saturday, June 6, 2015

Revers the character in word of a sentence. Like a given sentence


INPUT:  mithilesh kumar singh

RESULT:hselihtim ramuk hgnis


class Program

{
static void Main(string[] args)


{           
string Str, revers = "";


Console.WriteLine("Enter the santence");

Str = Console.ReadLine();

foreach (string word in Str.Split())

{
string temprev = "";


int lenth = word.Length - 1;

while(lenth>=0)

{
temprev = temprev + word[lenth];

lenth--;

}
revers = revers + temprev + " ";



}
Console.WriteLine(revers);


Console.ReadLine();

}

}


 OUTPUT

No comments: