© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•6mo ago•
34 replies
מורט

✅ need help with a basic code

nt x= 6
; int y = 7;
Console.WriteLine("what is x+y?");
string input = Console.ReadLine();
int answer;
if (int.TryParse(input, out answer)) {
if (answer == x+y) {
Console.WriteLine("correct");
{
else
}
Console.WriteLine("wrong, right answer is:)" + (x+y));
{
else
}
Console.WriteLine("enter a valid num");
Console.ReadLine();
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

Similar Threads

❔ Need help with basic string code
C#CC# / help
3y ago
❔ Need help with code analyzers
C#CC# / help
3y ago