Self Practice Problems Sheet
Self Practice Problems Sheet
IMPORTANT INSTRUCTIONS:
b. Prints on the console the number in reversed order: dcba (in our example
1102).
c. Puts the last digit in the first position: dabc (in our example 1201).
d. Exchanges the second and the third digits: acbd (in our example 2101).
PROBLEM 11. Write a program that checks if a given number n (1 < n < 100) is a
prime number (i.e. it is divisible without remainder only to itself and 1).
PROBLEM 12. Write a program that reads an integer number n from the console.
After that reads n numbers from the console and prints their sum.
PROBLEM 13. Write a program that prints on the console the first 100 numbers in the
Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, …
PROBLEM 14. Program that will calculate the sum of all odd integers in the range
[1…n], which are not divisible by 7 by using the for-loop