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

Ninth Revision Test

The document is a revision guide for Class IX, containing multiple-choice questions and short answer questions related to programming concepts. It covers topics such as data types, error types, loop execution, and specific programming outputs. The document also includes coding exercises and asks for differentiation between programming constructs.

Uploaded by

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

Ninth Revision Test

The document is a revision guide for Class IX, containing multiple-choice questions and short answer questions related to programming concepts. It covers topics such as data types, error types, loop execution, and specific programming outputs. The document also includes coding exercises and asks for differentiation between programming constructs.

Uploaded by

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

CLASS IX(REVISION)

Q1 Choose the correct answer:


1. Which of the following is non-primitive data?
a) char b) long c) object d) None
2. Integer type value occupies _____ bytes in the memory.
a) 4 b) 2 c) 6 d) 8
3. Name the type of error : int a;b;c;
a)Run Time error b) Logical error c) Syntax error d) None
4. The style of expressing single line comment is:
a)/* */ b) // c)\\ d) /** */
5. Name the package used for the Scanner class.
a) java.util b) java.lang) c) java.string d)None
6.What will be the result stored in X after evaluating the following
expression : int x=4;
X+=(X++) + (++X) + X;
a) 19 b)20 c) 21 d) None
7. What will be the output of a and b in the following .if int a,b;
a=10;b=a++;
a) 10,10 b) 10,11 c) 11,10 d) 11,11
8. Which of the following statement accomplishes a ‘fall through’?
a) for b) switch c) if-else d) None
9.How many times will the lop ,for(i=1; ;i++) , execute,if there is no
statement used to
terminate the loop?
a) 1 b) 0 c) infinite d) None
10. for(int i=10;i<10;i++)
{ statement;}
For how many times will the given loop statement be executed:
a) 1 time b) 10 times c) infinite d) None
Q2. Answer the following :
1. Differentiate between while and do- while
2. What is Logical error?
3. What is the use of break ?
4. Give the outputs of the following programs
i)class m1
{ void main()
{ char ch='y';
for(; ch=='y';)
{ ch='n';
System.out.print(ch); }}}
ii)class m2
{
void main()
{ int i=1;
for(; i<5;i++);
System.out.print(++i);
}}
iii)class m3{
void main()
{ for(char ch='A';ch<='Z';ch++)
{ int a=ch;
System.out.print(a+" "); }}}
iv) class m4
{ void main()
{ for(int x=10;x>=0;x=x-1)
{ if(x==5)
continue;
System.out.print(x); }}}
v)class m5
{ void main()
{ int x=-10;
boolean b=true;
while(b)
{ if(x<0)
{ x++;
continue;}
else
break; }
System.out.println(x); }
vi) Give output: int k=5,j=9;
k+=k++ - ++j + k;
System.out.println(“k=”+k);
System.out.println(“j=”+j);

vii) Rewrite the following program using do-while


void main()
{ int x,c;
for(x=10;c=20;c>=10;c=c+2)
{ x++;
System.out.println(x);}}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy