0
Why this code show error
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 =Convert.ToInt32 (Console .Readline()); if (age > 14 && age<18) Console.WriteLine("Teenager"); else if(age>=18) Console.WriteLine("Adult"); else{ if (age > 0) { Console.WriteLine("Child"); } else { Console.WriteLine("Something's wrong"); } } } } } 'Console' does not have definition for 'Readline'??
3 Antworten
+ 1
Firstly, next time please provide a link to the code. C# is a case sensitive language meaning wOrD and word in C# can be considered different identifiers. Problem is that you typed in Console.readline instead of Console.ReadLine hence the error " 'Console' does not have a definition for 'readline' ".
0
it doesn't work