Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to find the multiples of 3 c#

static void PrintNumbers()
{
    for (int i = 1; i <= 100; i++)
    {
        if (i % 3 == 0 && i % 5 == 0)
        {
            Console.WriteLine(i + " FizzBuzz");
        }
        else if ( i % 3 == 0)
        {
            Console.WriteLine(i + " Fizz");
        }
        else if (i % 5 == 0)
        {
            Console.WriteLine(i + " Buzz");
        }           
        else
        {
            Console.WriteLine(i);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: combobox selected item c# 
Csharp :: TimeZone in asp.net core 
Csharp :: wasd code for unity 
Csharp :: convert number of days into months c# 
Csharp :: meaning immutable and mutable 
Csharp :: unity c# cos inverse 
Csharp :: System.Drawing get from url 
Csharp :: .net core 6 autofac 
Csharp :: group by unique c# 
Csharp :: json serialization 
Csharp :: how read excel data in c# 
Csharp :: c# string right extension 
Csharp :: c# add key value pair to dictionary 
Csharp :: c# remove substring 
Csharp :: iterate though data in firebase unity 
Csharp :: serial number unity pro 
Csharp :: declare enum c# 
Csharp :: unity pause coroutine 
Csharp :: List C# add from List 
Csharp :: c# tuple 
Csharp :: how to sort a dictionary by value in c# 
Csharp :: get mouse inpuit new input system 
Csharp :: combobox in datagrid wpf 
Csharp :: find all factors of a given number 
Csharp :: double parse csharp removes decimal 
Csharp :: c# Intersectcase insensitive 
Csharp :: csharp 3d array length 
Csharp :: save position unity 
Csharp :: declarar lista c# 
Csharp :: invalidoperationexception c# ui thread 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =