Sollicitatievraag bij Bhavna

Write a program to store an array in reverse order into another array.

Antwoorden op sollicitatievragen

Anoniem

12 sep 2021

String s="Sonu"; //we take a string Char[]ch=s.Tochar[]; //we convert string to char Reversestring=Null; // take a null Reversestring For(int i=3;i<=3;i--) // we rotating to the loop 3 times ,here we print reverse so i values is "decrement" { Reversestring=Reversestring+ch[I];//This is the logic } Console.WriteLine(Reversestring);//we print the Reversestring Thank you

Anoniem

12 sep 2021

String s="Sonu"; Char[]ch=s.Tochar(); Reversestring=null; For(int i=3;I<=3;i--) { Reversestring=Reversestring+ch[i] } Conosle.WriteLine(Reversestring);