© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4w ago•
8 replies
prezzy

what is wrong with this?

beginner
bool keepRunning = true;

while (keepRunning)
{

Console.WriteLine("== Welcome to Bulls and cows == ");
Console.WriteLine("== 1.Play Bulls and Cows ==");
Console.WriteLine("== 2. Show Leaderboard == ");
Console.WriteLine(" == 3. Exit Bulls and Cows == ");

int userChoice = int.Parse(Console.ReadLine());

if (userChoice == 1);
{
PlayGame();
}

else if (userChoice == 2)
{
ShowLeaderboard();
}

else if (userChoice == 3)
{
keepRunning = false;
}

else
{
Console.WriteLine("Please enter a valid option!!!");
}








}
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

✅ What is wrong with this code???
C#CC# / help
17mo ago
what is wrong with this code
C#CC# / help
2y ago
what is wrong with this code?
C#CC# / help
4y ago
❔ What is wrong???
C#CC# / help
3y ago