© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
16 replies
Hunter1895

❔ Practicing Arrays

Console.Write("How many numbers do you want?: ");
int numberChoice = Console.Read();

if (numberChoice == 2)
{
Console.WriteLine("Which numbers are they?");
int numPick1 = Console.Read();
int numPick2 = Console.Read();
}
else
{
Environment.Exit(0);
}

Hi! I enter 2 when prompted for numberChoice. It exits instead of going to if. What am I doing wrong?
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

✅ Practicing delegates
C#CC# / help
3y ago
❔ Trouble practicing C#
C#CC# / help
3y ago
practicing on mutliple databases
C#CC# / help
2y ago
Practicing basics of c#
C#CC# / help
3y ago