0

How do i input string based text behind an answer?

lines of code are: // code start string name = Console.ReadLine(); Console.WriteLine("hey " + name " i like waffles); // code finish and i get an error every time, but if i delete the full "i like waffles" part it works????

23rd Feb 2022, 6:07 PM
sssharks
sssharks - avatar
4 odpowiedzi
+ 2
there is no plus sign after the variable "name". If it works without "i like waffles" then it should work after you add the '+'
23rd Feb 2022, 7:34 PM
Slick
Slick - avatar
+ 3
Console.WriteLine("Hi "+name+" i like waffles ");
23rd Feb 2022, 8:09 PM
Jackie
Jackie - avatar
0
If it's that exact code then probably it's because you're missing the closing parenthesis ( " ) after "i like waffles"
23rd Feb 2022, 7:25 PM
Slick
Slick - avatar
0
Slick Console.WriteLine("hey i am x what is your name?"); string name = Console.ReadLine(); Console.WriteLine("Hi " + name "i like waffles"); i wrote this but it doesnt work
23rd Feb 2022, 7:29 PM
sssharks
sssharks - avatar