Question: 1. FizzBuzz 2.0 by CodeChum Admin Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and
1. FizzBuzz 2.0
by CodeChum Admin
Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game:
- print "Fizz" if the number is divisible by 3
- print "Buzz" if the number is divisible by 5
- print "FizzBuzz" if the number is divisible by both 3 and 5
- print the number itself if none of the above conditions are met
Input
A line containing an integer.
15
Output
Multiple lines containing a string or an integer.
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz
2. Phonics
by CodeChum Admin
Did you know that the first letters in the alphabet that a child learns are the vowels? Well, since they're the first letters that we learned as babies, then they must be easy to identify, right? So, let's make a code that will identify all vowels in a string and print out how many they are! Let's go!
Input
A line containing a string.
CodeChum
Output
A line containing an integer.
3
3. The Last 'Zeroes'
by CodeChum Admin
How many zeroes are there after the last non-zero digit of a million? a trillion? To easily identify that, let us make a program to count and print the number of zeroes after the last non-zero digit of a number. For example, in 20400, there are 2 zeroes after the last non-zero digit of the number, 4.
Are you up for this challenge?
Input
A line containing an integer.
20400
Output
A line containing an integer.
2
4. Not Less than Three
by CodeChum Admin
Make a program that will accept an integer and loop from 1 to that integer. Then, print all numbers from that range that are greater than 3. Let's go!
Input
A line containing an integer.
8
Output
Multiple lines containing an integer.
4
5
6
7
8
5. Factorials
by CodeChum Admin
For those of you who may not now, a factorial is a product of multiplying from 1 until the number. Now, you must make a program that will accept an integer and then print out its factorial using loops.
Are you up for this task?
Instructions:
- Input a positive integer.
- Using a for() loop, generate the factorial value of the integer and print out the result.
- Tip #1: Factorials work like this: Factorial of 5 = 1 * 2 * 3 * 4 * 5
- Tip #2: There's a special case in factorials. The factorial of 0 is 1.
Input
A line containing an integer.
5
Output
A line containing an integer.
120
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
