0

Why can't I run this code on this app?

using Sytem; namespace Learning_Variables { class Program { static void Main(string[] args) { double num01; double num02; double num03; Console.Write("Input a number: "); Convert.ToDouble( Console.ReadLine() ); Console.Write("Input a second number"); Convert.ToDouble( Console.ReadLine() ); Console.Write("Input a third number"); Convert.ToDouble( Console.ReadLine() ); double xyz = num01 + num02 + num03; double result = (xyz / 3); Console.WriteLine("The average of these numbers is " + result ); Console.ReadKey(); } } }

29th Dec 2021, 9:27 PM
Thunderbolt
Thunderbolt - avatar
3 Answers
+ 3
Do this code run on other IDEs? Only a question, because you don't have assigned the variables num01... num03 Like this: num01 = Convert.ToDouble( Console.ReadLine() ); The " num01 =" part is missing for all three variables.
29th Dec 2021, 9:48 PM
Coding Cat
Coding Cat - avatar
+ 3
And write using System; Instead of; using Sytem;
29th Dec 2021, 9:58 PM
Coding Cat
Coding Cat - avatar
0
Thank you! šŸ™
30th Dec 2021, 6:31 AM
Thunderbolt
Thunderbolt - avatar