Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Jackie_ProgrammingTest_1

using System.IO;
using System;

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

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.