+ 3

Could you please.help me, I don't know what is wrong? Thanks

https://code.sololearn.com/chnbY125rZ3l/?ref=app

6th Oct 2018, 3:37 PM
Pƙemek Janda
Pƙemek Janda - avatar
3 Answers
+ 2
I made a few changes, troubled lines had been commented. using System; namespace SoloLearn { class Program { static void Main(string[] args) { int x = 1; int y = 2; //Console.WriteLine("What is esult of " + x + "*" + y " ?"); Console.Write("What is result of " + x + "*" + y + " ? "); //int result = Convert.ToInt32(Console.Read()); int result = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(result); //int anwser = x*y; int answer = x*y; switch (Math.Abs(answer - result)) { case 0: Console.WriteLine("Well done boii"); break; case 1: Console.WriteLine("You are very close"); break; case 2: Console.WriteLine("Not bad but still wrong"); break ; case 3: Console.WriteLine("You are totaly out"); break; default: Console.WriteLine ("You have no idea what math means"); break; } } } }
6th Oct 2018, 4:15 PM
Ipang
+ 3
Oh thank you so much, you gave me useful sight on the matter.
6th Oct 2018, 4:46 PM
Pƙemek Janda
Pƙemek Janda - avatar
+ 1
You're welcome! glad if it helps : )
6th Oct 2018, 4:48 PM
Ipang