What is wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is wrong?

I can't seem to understand this. I've been fiddling for hours and I can't seem to get it. It's really frustrating because it looks like it should work 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) { int age = 17; if (age > 14){ if (age>18){ Console.Writeline("adult"); } else{ Console.WriteLine("teen"); } } else{ if(age>0){ Console.Writeline("child"); } else{ Console.WriteLine("what the hell"); } } } } } }

21st Jun 2018, 5:57 AM
Captain Fach
Captain Fach - avatar
3 Answers
+ 2
Thats because there is no definition for 'Writeline' but there is one for 'WriteLine' And get rid of that last paren.
21st Jun 2018, 6:30 AM
ODLNT
ODLNT - avatar
+ 1
extra else
21st Jun 2018, 6:09 AM
‎ ‏‏‎Anonymous Guy
0
it can't be that. I removed it and it keeps saying something like no definition for writeline
21st Jun 2018, 6:27 AM
Captain Fach
Captain Fach - avatar