Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fb74c0
commit 251a720
Showing
2 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @author: imkaka | ||
* @date: 20/12/2018 | ||
*/ | ||
|
||
using System; | ||
|
||
public class FizzBuzz{ | ||
|
||
public static void Main(string[] args){ | ||
|
||
Console.WriteLine("/*====== Fizz Buzz ======*/"); | ||
|
||
Console.WriteLine("Enter a Number : "); | ||
int input = Convert.ToInt32(Console.ReadLine()); | ||
|
||
for(int i=1; i <= input; ++i){ | ||
|
||
string res = ""; | ||
|
||
if(i % 3 == 0) res += "Fizz"; | ||
if(i % 5 == 0) res += "Buzz"; | ||
|
||
if(res == "") res = i.ToString(); | ||
|
||
Console.WriteLine(res); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters