Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 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.                     if ((x % 3 != 0) && (x % 5 != 0))
  15.                     {
  16.                         Console.WriteLine(x);
  17.                     }
  18.                     if ((x%3 == 0)!=(x%5==0))
  19.                     {
  20.                         Console.WriteLine("fizz {0}", x);
  21.                     }
  22.      
  23.                     if ((x%5 == 0)!=(x%3==0))
  24.                     {
  25.                         Console.WriteLine("bizz {0}", x);
  26.                     }
  27.                     if ((x%3==0) && (x%5==0))
  28.                     {
  29.                         Console.WriteLine("fizzbizz {0}", x);
  30.                     }
  31.                 }
  32.          
  33.                 Console.ReadKey();
  34.             }
  35.         }
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement