Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views2 pages

Iterative Statementqans

The document contains a series of programming questions and tasks related to Java, focusing on loops, jump statements, and various coding problems. It covers topics such as entry and exit controlled loops, the differences between break and continue statements, and infinite loops, along with syntax for different types of loops. Additionally, it includes specific programming assignments that require writing Java code for tasks like printing numbers, calculating series, and displaying patterns.

Uploaded by

sharmapradnya25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Iterative Statementqans

The document contains a series of programming questions and tasks related to Java, focusing on loops, jump statements, and various coding problems. It covers topics such as entry and exit controlled loops, the differences between break and continue statements, and infinite loops, along with syntax for different types of loops. Additionally, it includes specific programming assignments that require writing Java code for tasks like printing numbers, calculating series, and displaying patterns.

Uploaded by

sharmapradnya25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Q1 Write two jump statements and their uses.

Q2 State the difference between entry controlled loop and exit controlled loop

Q3 What is the difference between a break statement and a continue statement when they occur in
a loop?

Q4 What is an infinite loop? Explain with an example.

Q5 Write syntax of i) for loop ii) while loop iii) do – while loop with appropriate examples.

Q6 State one similarity and one difference between i) while and do – while loop

ii) while and for loop

Write the Java code for the following problems-

i) WAP to print odd and even numbers between 1 to 100

ii) WAP to print table of a number taken from user.

iii) WAP to print the first ten terms of the following series-

a) 1, 4, 9, 16………

b) 1.5, 3.0, 4.5, 6.0……………………..

c) 0, 7, 20, …….

d) 1, 9, 25, 49,……………………….

e) 24, 99, 224, 399……………………..

iv) WAP to display all the ‘Buzz Numbers’ between p and q (where p<q). A ‘Buzz Number’ is the
number which ends with 7 or is divisible by 7.

v) WAP to input marks in English, Maths and Science of 40 students who have passed ICSE
Examination 2024. Now, perform the following tasks :

a) Fins and display the number of students, who have secured 95% or more in aggregate.

b) Find and display the number of students, who have secured 90% or more in English, Maths and
Science.

vi) WAP to print the sum of the given series –

1 1 1 1 1
S=1+ + + + +………………………+
2 3 4 5 20
vii) WAP to print the Mathematical Table from 5 to 10 for 10 iterations in the given format:

Sample output : Table of 5

5*1=5

5 * 2 = 10

………..

………….
5 * 10 = 50

viii) WAP to accept any 20 numbers and display only those numbers which are prime.

ix) Write a menu driven program to display all prime and non prime numbers from 1 to 100.

Enter 1 : to display all prime numbers

Enter 2 : to display all non – prime numbers

x) WAP to display the following pattern –

a) 1 1 1 1 1 b) 5 5 5 5 5 c) 1 d) 1 2 3 4 5 e) 5 4 3 2 1

22222 44444 12 1234 5432

33333 33333 123 123 543

44444 22222 1234 12 54

55555 11111 1 2 3 4 `5 1 5

You might also like