© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
68 replies
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

Cannot implicitly convert int to string
C#CC# / help
13mo ago
❔ How would one convert string to int?
C#CC# / help
3y ago