# Break Statement

**URL:** <https://forum.codewithmosh.com/t/break-statement/17428>\
**Category:** C++\
**Created:** [January 4, 2023, 1:49am UTC](https://forum.codewithmosh.com/t/break-statement/17428 "2023-01-04T01:49:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![swinston07](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@swinston07](https://forum.codewithmosh.com/u/swinston07)\
**Post date:** [January 4, 2023, 1:49am UTC](https://forum.codewithmosh.com/t/break-statement/17428/1 "2023-01-04T01:49:57Z")

</div>

So I created a break statement, in which I wanted a while loop to continue until the use inputted the letter r. However, the loop end as soon as the first letter is entered. Do any of you have the reason why this may be happening?

 ![Screenshot (4)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/c/c2ed0eeb0fb37594b7c9581ca59cc44740f4f998.png)

---

<div class="post-metadata">

**Author:** ![Kosher](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@Kosher](https://forum.codewithmosh.com/u/Kosher)\
**Post date:** [January 4, 2023, 5:39am UTC](https://forum.codewithmosh.com/t/break-statement/17428/2 "2023-01-04T05:39:03Z")

</div>

In your _if_ statement, use two == for the comparison

```auto
if (guess == secret)

```
