---
id: 647e1f4e8acb466c97ccbedf
title: Add Looping Logic to Your Code Using the do-while and while Statements in C#
challengeType: 19
dashedName: add-looping-logic-to-your-code-using-the-do-while-and-while-statements-in-c-sharp
---

# --description--

This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:

1. Go to <a href="https://learn.microsoft.com/training/modules/csharp-do-while/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/csharp-do-while/</a> and complete all the tasks for the "Add Looping Logic to Your Code Using the do-while and while Statements in C#" module. This is **required** to earn the "Add Logic to C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
1. When you are finished, come back and correctly answer the question below.

# --assignment--

Complete the <a href="https://learn.microsoft.com/training/modules/csharp-do-while/" target="_blank" rel="noreferrer">Add Looping Logic to Your Code Using the `do`-`while` and `while` Statements in C#</a> module on Microsoft Learn. Then, answer the question below.

# --questions--

## --text--

A developer needs to iterate through an array of items to find one that matches a certain criteria. Which is the best iteration statement for this purpose?

## --answers--

`foreach`

---

`for`

---

`while`

## --video-solution--

1
