L5_-_Java__Practice_Problems_Intermediate
L5_-_Java__Practice_Problems_Intermediate
1. FizzBuzz Problem
2. Break
a) Danger_number
b) FizzBuzz variation: stop as soon as sum of i’s exceeds 3*N
3. Continue
a) FizzBuzz variation: Do nothing if i is a multiple of 4.
4. Practice:
a) Find number of digits of a given number
b) Find sum of digits of a given number
c) Print sum of digits for all the numbers in a given range [L, R]
Given a value of N,
print only those numbers
from 1 to N that have
sum of digits = K
What if updation is
not the same
everytime?
While Loop int i =
1;
out-printen (c),
I body System.
i + +j
3
3 END
↑
-> condition
>
-
do >
-
condition
don
do- condition >
-
Condition >
-
>
Do While Loop
/Erbes
1 - 1
2 -> 2
15
k
i
=
L
10 + ( Output : 69
Print first N numbers 78
? that have their
87
14- 5 sum of digits = K
96
↓ 159
63 - I
↓
CS6 - 22
(1) 87 +
25(3) 225 98 -
69-15 13
! 157 +
1592
I ISS th
78-252)
96 -
25(a) 1357 12
I5 -
More
Practice
Given a positive number, check if
it’s prime or not
Thank You!