Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to create an infinite loop in C#?
An infinite loop is a loop that never terminates and repeats indefinitely.
Let us see an example to create an infinite loop in C#.
Example
using System;
namespace Demo {
class Program {
static void Main(string[] args) {
for (int a = 0; a Above, the loop executes until a
int a = 0;
The value of a decrements after each iteration since it is set to.
a--;
Therefore the value of a will never be above 50 and the condition a
Advertisements
