Answers for "c# do for loop"

C#
0

c# loop

for(int i=0;i<5;i++)
{
 Console.WriteLine(i);
}
Posted by: Guest on February-25-2022
0

c# Loop Example

bool isPrime = false;
int number = 2;
while (number <= 100)
{
    isPrime = true;
    for (int i = 2; i < number; ++i)
    {
        if (number % i == 0)
        {
            isPrime = false;
            break;
        }
    }
    if (isPrime)
    {
        Console.Write(number);
        Console.Write(" ");
    }
    number++;
}
Posted by: Guest on December-26-2021

C# Answers by Framework

Browse Popular Code Answers by Language