Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace FizzBizz
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             for (int x = 1; x <= 100; x++)
  13.             {
  14.  
  15.                 if (x % 3 == 0 && x % 5 == 0)
  16.                 {
  17.                     Console.WriteLine("fizzbizz");
  18.                 }
  19.                 else
  20.                 {
  21.                     if (x%3 == 0)
  22.                     {
  23.                         Console.WriteLine("fizz");
  24.                     }
  25.  
  26.                     if (x%5 == 0)
  27.                     {
  28.                         Console.WriteLine("bizz");
  29.                     }
  30.                     if (x%3 != 0 && x%5 != 0)
  31.                     {
  32.                         Console.WriteLine(x);
  33.                     }
  34.  
  35.  
  36.                 }
  37.             }
  38.  
  39.             Console.ReadKey();
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement