---
title: "While Loop in c#"  
description: "While Loop in c#"  
author: "Anonymous User"  
published: 2015-12-01  
updated: 2015-12-01  
canonical: https://www.mindstick.com/forum/33669/while-loop-in-c-sharp  
category: "c#"  
tags: ["c#", "loop"]  
reading_time: 1 minute  

---

# While Loop in c#

I want to use while [loop in c#](https://www.mindstick.com/forum/33670/do-while-loop-in-c-sharp) please help me

## Replies

### Reply by Anonymous User

The [while loop](https://www.mindstick.com/forum/34579/while-loop-in-python) is one of the important looping construct, that is being widely used in C sharp programming language

**it three things are important.**

1. Initialization

2. Increment/Decrement

3. Termination

These are the important characteristics of any loop. Initialization represents the starting position from there your loop will be started. In the below example int i=0 refers to initialization of while loop. i++ refers to increment/decrement and finally while(i<10) refers to the termination of while loop.

```
using System;namespace While{    class Program    {        static void Main(string[] args)        {            int num, Result, i;            Console.WriteLine("Enter a number");            num = Convert.ToInt32(Console.ReadLine());            i = 1;                       while (i <= 10)            {                Result = num * i;                Console.WriteLine("{0} x {1} = {2}", num, i, Result);                i++;              }            Console.ReadLine();        }    }}
```

![While Loop in c#](https://www.mindstick.com/mindstickforums/d73a665b-3b6d-49ce-9c21-d0ed87811e02/images/5c061359-2896-42df-9f10-7d88f46e7461.png)


---

Original Source: https://www.mindstick.com/forum/33669/while-loop-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
