0

Why this isn't working? possible solutions...?

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()); int a= Convert.ToInt32(Console.ReadLine()); int g= Console.WriteLine("You are {0} years old", age+a); } } }

6th Jul 2017, 7:42 AM
JahirZaed
JahirZaed - avatar
7 Antworten
+ 4
you dont need int g.
6th Jul 2017, 7:46 AM
Hello Buddy
Hello Buddy - avatar
0
the code shows "can't concert from void to int implicitly" what does it mean?
6th Jul 2017, 7:48 AM
JahirZaed
JahirZaed - avatar
0
*convert
6th Jul 2017, 7:49 AM
JahirZaed
JahirZaed - avatar
0
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()); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("You are {0} years old", age+a); } } } it works fine for me.
6th Jul 2017, 8:25 AM
Hello Buddy
Hello Buddy - avatar
0
you said without using Convert.Toint32😒
6th Jul 2017, 1:41 PM
JahirZaed
JahirZaed - avatar
- 1
you dont need Convert.ToInt32 becauae your variable is integer.
6th Jul 2017, 8:04 AM
Hello Buddy
Hello Buddy - avatar
- 1
but it doesn't work...@ kukuh 060696
6th Jul 2017, 8:07 AM
JahirZaed
JahirZaed - avatar