@@ -51,7 +51,7 @@ fizzbuzz (17);
51
51
*/
52
52
53
53
// Step 1: Run a loop from 1 to n, for reach iteration (i) perform the next steps
54
- // Step 2: Declare a temporary empty string (inside loop, say output)
54
+ // Step 2: Declare a temporary empty string (inside loop, say output)
55
55
// Step 3: If i is divisible by 3, append Fizz to the output.
56
56
// Step 4: If i is divisible by 5, append Buzz to the output.
57
57
// Step 5: If output is still an empty string, set it equal to i
@@ -65,7 +65,7 @@ function fizzbuzz (num) {
65
65
if (i% 5 === 0 ) opStr += ' Buzz' ;
66
66
67
67
if (opStr === ' ' ) opStr = i;
68
-
68
+
69
69
console .log (opStr);
70
70
}
71
71
}
@@ -82,7 +82,7 @@ fizzbuzz (17);
82
82
* @author : MadhavBahlMD
83
83
* @date: 20/12/2018
84
84
*/
85
-
85
+
86
86
import java.util.Scanner ;
87
87
88
88
public class Fizzbuzz {
@@ -113,7 +113,7 @@ public class Fizzbuzz {
113
113
114
114
``` c
115
115
/* *
116
- * @author: Rajdeep Roy Chowdhury<[email protected] >
116
+ * @author: Rajdeep Roy Chowdhury<[email protected] >
117
117
* @github: https://github.com/razdeep
118
118
* @date: 20/12/2018
119
119
**/
@@ -154,7 +154,7 @@ int main()
154
154
155
155
``` c
156
156
' ' '
157
- * @author: Hrishi Patel <[email protected] >
157
+ * @author: Hrishi Patel <[email protected] >
158
158
* @github: https://github.com/hrishi1999
159
159
* @date: 20/12/2018
160
160
' ' '
@@ -178,7 +178,7 @@ for i in range(1, n):
178
178
179
179
```c
180
180
'''
181
- * @author: Deepak Sharma
181
+ * @author: Deepak Sharma
182
182
* @github: https://github.com/dsdsharma
183
183
* @date: 20/12/2018
184
184
'''
@@ -202,9 +202,45 @@ int main()
202
202
}else{
203
203
cout << i << " ";
204
204
}
205
-
205
+
206
206
}
207
-
207
+
208
208
return 0;
209
209
}
210
210
```
211
+
212
+ ### [ C# Solution] ( ./C#/FizzBuzz.cs )
213
+
214
+ ``` cs
215
+ /**
216
+ * @author imkaka
217
+ * @date 20/12/2018
218
+ */
219
+
220
+
221
+ using System ;
222
+
223
+ public class FizzBuzz {
224
+
225
+ public static void Main (string [] args ){
226
+
227
+ Console .WriteLine (" /*====== Fizz Buzz ======*/" );
228
+
229
+ Console .WriteLine (" Enter a Number : " );
230
+ int input = Convert .ToInt32 (Console .ReadLine ());
231
+
232
+ for (int i = 1 ; i <= input ; ++ i ){
233
+
234
+ string res = " " ;
235
+
236
+ if (i % 3 == 0 ) res += " Fizz" ;
237
+ if (i % 5 == 0 ) res += " Buzz" ;
238
+
239
+ if (res == " " ) res = i .ToString ();
240
+
241
+ Console .WriteLine (res );
242
+ }
243
+ }
244
+ }
245
+
246
+ ```
0 commit comments