+ 4
Help please, i cant find a mistake in C#
can u check mistakes? Many thanks for my helpers :) 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) { Console.Writeline("Enter Your Age, please") String YourAge = 0 Console.Readline() If (YourAge >= 18 ) Console.Writeline("You have authorized"); Else Console.Writeline("You didn't authorized"); } } }
5 Réponses
+ 3
many thanks, good luck for you and your coding experience :))
+ 2
You are welcome, have fun learning!
+ 1
You did not assign YourAge.
Shouldn't you do
YourAge = Console.Readline();
?
+ 1
Well readline reads a string. You comparing it means it should he an integer. I don't know C#, but convert YourAge to an integer after you use ReadLine()
Can you add the code to code playground and link it here? That will make it much easier to help.