Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

Commit fa5863e

Browse files
committed
Fizzbuzz in awk
This is an normal implementation of FizzBuzz in awk scripting language.
1 parent c383bff commit fa5863e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: Awk/fizzbuzz.awk

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BEGIN {
2+
printf "Enter value of n: ";
3+
# Reading value entered by user as string
4+
getline n < "-";
5+
# Converting the type of n from string to int
6+
n = n + 0
7+
for (i = 1; i <= n; ++i) {
8+
if(i % 15 == 0) print "FizzBuzz";
9+
else if (i % 5 == 0) print "Buzz";
10+
else if (i % 3 == 0) print "Fizz";
11+
else print i;
12+
}
13+
}

0 commit comments

Comments
 (0)