C#C
C#3y ago
Aelia

Not being able convert from string to int

static void test()
{
Console.Write("Ange det första heltalet: ");
string input1 = int.Parse(Console.ReadLine());

Console.Write("Ange det andra heltalet: ");
string input2 = int.Parse(Console.ReadLine());

int summa = input1 + input2;
Console.WriteLine("Summan är:" + summa);
}

what am i doing wrong?
image.png
Was this page helpful?