C# nested while loops and multiple conditions

C# nested while loops and multiple conditions

Today, We want to share with you C# nested while loops and multiple conditions.
In this post we will show you Nested loops in C# programming, hear for c# while true Check we will give you demo and example for implement.
In this post, we will learn about c# while loop multiple conditions with an example.

Nested while Loop in C#

Syntax for Nested while Loop in C#:

while (condition)
{
    while (condition)
    {
        your statements;
    }
    your statements;
}

Nested loops in C# programming

while ((!mystring.Contains("pakainfo")) || (NewData != OldData) || (totalcount < 100))
{
    //while at least more to one those right conditions is true, then  this while loop will work
}

Is logically equivalent to your

while ((v3.IsAlive) || ((v2.IsAlive) || v1.IsAlive))
//do stuff

jQuery 15 Powerful Tips and Tricks for Developers and Web Designer

die when v3 ends or when both v2 and v1 end

while (v3.IsAlive || v2.IsAlive || v1.IsAlive)
//do stuff

Example 1: C# program of Nested while Loop

using System;
namespace loop
{
    class Wprogram
    {
        static void Main(string[] args)
        {
            int startpoint = 5;
            while (startpoint >= 1)
            {
                int j = 5;
                while (j >= startpoint)
                {
                    Console.Write(j);
                    j--;
                }
                startpoint--;
                Console.WriteLine();
            }
            Console.Read();
        }
    }
}

OutPut : C# program of Nested while Loop

5
54
543
5432
54321

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about C Sharp Looping with do and while Statements.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1.   Angularjs Bootstrap Progress Bars Example
  2.   5 Star Product Rating Review Widget in CSS
  3.   Laravel 5.8 AJAX Tutorial Example From Scratch
  4.   sticky Scroll Back to Top Button using jQuery and CSS
  5.   Get all checked Checkbox Values in AngularJS
  6.   gcd of two numbers in c program
  7.   Angular 8 Material Table Filter Sorting Paging
  8.   Laravel Validation and Bootstrap Modal Popup Form Submit with Ajax
  9.   laravel get all query string
  10.   Simple PHP jQuery Ajax Insert Update Delete using MySQLi