> For the complete documentation index, see [llms.txt](https://eleven-fifty-academy.gitbook.io/dotnet-100-prework-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eleven-fifty-academy.gitbook.io/dotnet-100-prework-gitbook/part-3-c-fundamentals/6.0-booleans/6.0b-challenge-answers.md).

# 6.0b: Challenge Answers

## Bronze:

```csharp
class Program
{
    static void Main(string[] args)
    {
        int value = 100 / 2;
        if (value == 50)
        {
            Console.WriteLine(true);
        }

        else
        {
            Console.WriteLine(false);
        }
    }
}
```

## Silver:

```csharp
class Program
{
    static void Main(string[] args)
    {
        double value = 101d / 2d;
        if (value == 50d)
        {
            Console.WriteLine(true);
        }

        else if (value != 50d)
        {
            Console.WriteLine(false);
        }
    }
}
```

## Gold:

Your programs may vary a little bit but it should look something like this:\
1\. Print the rules of the game to the console 2. Save the user's input to the `ReadLine()` and use `Convert.ToInt16()` so the program will convert the user's input back to a string 3. Create `if`, `else if`, and `else` statements inputting the range the statement will use and the data the program will spit out if the statement is true. 4. Try typing `if` then press the tab key twice and it will scaffold out an `if` statement for you.

## Discussion

`if` statements will always be run within the program. `Else if` statements will only be run if the previous statements were not true. `Else` statements will only be run if none of the other statements were true.

```csharp
 class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Can you guess what number I am thinking of? It is between 1-20");
        int guessNumber = Convert.ToInt16(Console.ReadLine());
        if (guessNumber <= 7 && guessNumber >= 1)
        {
            Console.WriteLine("You need to go much higher!");
        }
        else if (guessNumber <= 14 && guessNumber > 7)
        {
            Console.WriteLine("Little bit higher!");
        }
        else if (guessNumber == 15)
        {
            Console.WriteLine("Winner Winner Chicken Dinner!");
        }
        else if (guessNumber >= 16 && guessNumber <= 20)
        {
            Console.WriteLine("Oops, little bit lower");
        }
        else
        {
            Console.WriteLine("Did you read the instructions?");
        }
        Console.ReadLine();
    }
}
```

[Next:](https://github.com/ElevenfiftyAcademy/DotNet-100-PreWork-GitBook/tree/64a482bc021f16990ae3bfbab4dece0d1968c653/part-3-c-fundamentals/7.0-conditionals) Conditionals


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eleven-fifty-academy.gitbook.io/dotnet-100-prework-gitbook/part-3-c-fundamentals/6.0-booleans/6.0b-challenge-answers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
