Extra-Terrestrials | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
21st Mar 2020, 11:16 PM
GAG98
GAG98 - avatar
2 Answers
0
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string a; string b; a = Console.ReadLine(); // captures input in a b = ""; // initialise string otherwise += does not work for(int i=a.Length-1; i>=0; i--) // sizeof used for type memory not string length. Use the length attribute instead. Arrays start at 0 so last element is one less than length. { b+=a[i]; } Console.Write(b); } } }
22nd Mar 2020, 4:33 AM
Adam McGregor
0
thanks man
22nd Mar 2020, 9:00 AM
GAG98
GAG98 - avatar