0
Extra-Terrestrials
do I do anything rightïŒ https://code.sololearn.com/cR5KcPIWW1P2/?ref=app
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);
}
}
}
0
thanks man