Exercises
Exercises
Instructions:
For each exercise, write the complete C++ program that solves the problem. Include
comments in your code to explain your thought process and the steps taken. Test
your code to ensure it works correctly before submission.
Sample Output:**
Enter an integer: 7
Sample Output:
Result: 10 + 5 = 15
Sample Output:
Enter a number: 11
11 is a prime number.
Sample Output:
Factorial of 5 is 120.
⮚ A: 90-100
⮚ B: 80-89
⮚ C: 70-79
⮚ D: 60-69
⮚ F: 0-59
Sample Output:
Enter a number: 3
3x1=3
3x2=6
3x3=9
3 x 10 = 30
Sample Output:
Sample Output:
Exercise 9: FizzBuzz
Implement the FizzBuzz problem. Your program should print the numbers from 1 to
100, but for multiples of 3, print "Fizz" instead of the number, and for the multiples of
5, print "Buzz." For numbers that are multiples of both three and five, print "FizzBuzz."
Sample Output:
Fizz
Buzz
Fizz
Fizz
Buzz
...
Sample Output:
```
```