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); } } }
7 Antworten
+ 4
you dont need int g.
0
the code shows
"can't concert from void to int implicitly"
what does it mean?
0
*convert
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.
0
you said without using Convert.Toint32😒
- 1
you dont need Convert.ToInt32 becauae your variable is integer.
- 1
but it doesn't work...@ kukuh 060696