मराठी

(English Medium) ICSE Class 10 - CISCE Important Questions

Advertisements
[object Object]
[object Object]
विषय
मुख्य विषय
अध्याय

Please select a subject first

Advertisements
Advertisements
< prev  1621 to 1640 of 4320  next > 

Write two separate programs to generate the following patterns using iteration (loop) statement:

(a)

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Write two separate programs to generate the following patterns using iteration (loop) statement:

(b) 

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Study the method and answer the given questions.
public void sampleMethod()
{ for (int i=0; i < 3; i++)
{ for (int j = 0; j<2; j++)
{int number = (int) (Math.random() * 10);
System.out.println(number); } } }
(i) How many times does the loop execute ?
(ii) What is the range of possible values stored in the variable number ? 

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

Study the method and answer the given questions.
public void sampleMethod()

{ for (int i=0; i < 3; i++)
{ for (int j = 0; j<2; j++)
{int number = (int) (Math.random() * 10);
System.out.println(number); } } }
(i) How many times does the loop execute ?

(ii) What is the range of possible values stored in the variable number ?

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

The access modifier that gives the most accessibility is ______

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

State the type of loop in the given program segment

for (int i = 5; i l = 0; i =2)

System.out.println(i);

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

The access specifier that gives least accessibility is ______.

Appears in 1 question paper
Chapter: [8] Encapsulation and Inheritance
Concept: Introduction to Encapsulation

Which of the following are entry-controlled loops?

  1. for
  2. while
  3. do..while
  4. switch
Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

To execute a loop 10 times, which of the following is correct?

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

How many times will the following loop execute? Write the output of the code:

int x=10;
while(true) {
System.out.println(x++*2);
if(x%3==0)
break;
}
Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Entry Controlled Loop

Define a class to accept a number and check whether it is a SUPERSPY number or not. A number is called SUPERSPY if the sum of the digits equals the number of the digits.

Example1:

Input: 1021

Output: SUPERSPY number [SUM OF THE DIGITS = 1+0+2+1 = 4, NUMBER OF DIGITS = 4]

Example2:

Input: 125

Output: Not an SUPERSPY number [1+2+5 is not equal to 3]

Appears in 1 question paper
Chapter: [8] Iterative Constructs in Java
Concept: Introduction of Iterative Constructs in Java

Give the output of following code and mention how many times the loop will execute?

int i;
for(i=5; i> =l;i~)
{
if(i%2 ==1)
continue;
System.out.print(i+ ”
}

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Give the output of the following program segment and also mention the number of times the loop is executed:

int a,b;
for (a=6, b=4; a< =24; a=a + 6)
{
if (a%b= =0)
break;
}
System, out .println(a);

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Write the output:
charch= ‘F’;
int m= ch;
m=m+5;
System.out.println(m+ ” ” +ch);

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Convert following do-while loop into for loop.
int i = 1;
int d = 5;
do {
d=d*2;
System.out.println(d);
i+ + ; } while (i< =5);

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Analyze the given program segment and answer the following questions : 

for(int i = 3; i <= 4; i++){
    for(int j = 2; j <i; j++){
        System.out.print("");
    }
    System.out.println("WIN");
}

(i) How many times does the inner loop execute ?
(ii) Write the output of the program segment.

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

State the difference between while and do-while loop.

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Convert the following while loop to the corresponding for loop: 

int m = 5, n = 10;
while (n >= 1)
{
System.out.println(m*n);
n--;
}
Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Analyze the given program segment and answer the following questions:

(i) Write the output of the program segment.
(ii) How many times does the body of the loop gets executed?

for (int m=5; m<=20;m+=5)
{   if(m%3==0)
   break;
else
if(m%5==0)
System.out.println(m);
continue;
}

Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop

Give the output of the following program segment and also mention how many times the loop is executed : 

int i; 
for (i = 5; i > 10; i++) 
System.out.println(i); 
System.out.println(i * 4);
Appears in 1 question paper
Chapter: [9] Nested Loop
Concept: Introduction of Nested Loop
< prev  1621 to 1640 of 4320  next > 
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×