Code Correction | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Code Correction

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 name; Console.WriteLine("who are you"); Console.ReadLine(); Console.WriteLine("you are {0}"); } } } // i want to write a code that will ask "who are you" the user will write his name. Then output should be "you are ( the name he put )" What corrections should i do to make it work?

2nd Feb 2019, 6:56 AM
Raptor Bot
Raptor Bot - avatar
1 Answer
+ 2
hi Raptor Bot change the Console.ReadLine(); to string name = Console.ReadLine(); and then change Console.WriteLine(“you are {0}”); to Console.WriteLine(“you are {0}”, name); if you need any more help with this just ask
2nd Feb 2019, 7:39 AM
Ollie Q
Ollie Q - avatar