Iteration through loops (Nested)
This Page contains the practice questions based on nested loops for Class IX and X Students. Feel Free to ask your query if any problem occurs in solving any of the question.
1. WAP to gererate all perfect numbers between 1 to 100. (Perfect numbers are those numbers for which the sum of factors of the number is equal to the number.)
2. WAP to generate all prime numbers between 50 to 500.
3. WAP to generate all twin prime numbers between 1 to 1000. (The prime numbers whose difference is two, are said as twin prime numbers. E.g. (3,5), (5, 7), (11, 13) (17, 19).
4. WAP to calculate the squares of all the numbers between 1 to 100 without using any in-built function.
5. WAP to generate the following formats :
a. 1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
b. 5
5 4
5 4 3
5 4 3 2
5 4 3 2 1
c. 9 8 7 6 5
9 8 7 6
9 8 7
9 8
9
d. 1
2 3
4 5 6
7 8 9 10
e. 9
9 8
9 8 7
9 8 7 6
9 8 7 6 5
f. 1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
g. 5
4 5
3 4 5
2 3 4 5
1 2 3 4 5
h. 9 8 7 6 5
8 7 6 5
7 6 5
6 5
5
i. 1
2 3
4 5 1
2 3 4 5
j. 9
8 9
7 8 9
6 7 8 9
5 6 7 8 9
k. 1
2 3
4 5 1
2 3 4 5
1 2 3 4 5
6. WAP to find the sum of following serieses:
7. WAP to print the following formats :
a. #
* *
! ! !
~ ~ ~ ~
$ $ $ $ $
b. 9
8 8
7 7 7
6 6 6 6
5 5 5 5 5
c. *
* *
* * *
* *
*
d. 1
3 3 3
5 5 5 5 5
7 7 7 7 7 7 7
5 5 5 5 5
3 3 3
1
e. $ $ $ $ $
$ $ $
$
$ $ $
$ $ $ $ $
Free Web Counter
1 comments:
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging
Dot Net Training In Chennai | Dot Net Training Institute In Chennai | Dot Net Course In Chennai
Software Testing Training Chennai | Software Testing Course In Chennai | Testing Courses In Chennai
Java Training Institute in Chennai | Core Java Training in Chennai | Java Course and Certification
PHP Course in Chennai | PHP Training Institute in Chennai | PHP Course and Certification
Post a Comment