Sail E0 Webinar
Question
What will be the output of given code snippet?static void Main(string[] args) {     string h = "i lovelife";     string h1 = new string(h.Reverse().ToArray());     Console.WriteLine(h1);     Console.ReadLine(); }
Options:
A .  efil evoli
B .  lifelove i
C .  efilevol i
D .  efil evol i
Answer: Option C


Reverse() an inbuilt method reverses all the characters singly and hence embed them into the string completely.
Output :efilevol i



Was this answer helpful ?

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers