-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfizzbuzz.cs
More file actions
33 lines (31 loc) · 723 Bytes
/
fizzbuzz.cs
File metadata and controls
33 lines (31 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Written/tested in Visual Studio 2017
using System;
namespace FizzBuzz
{
class Program
{
static void Main(string[] args)
{
string o;
for(int i=1;i<=100;i++)
{
o = "";
if (i%3==0)
{
o += "Fizz";
}
if (i % 5 == 0)
{
o += "Buzz";
}
else
{
o = i.ToString();
}
Console.WriteLine(o);
}
// You may want to uncomment this in some cases to read the result
// Console.ReadKey();
}
}
}