9th 1st Term Paper - Retest
9th 1st Term Paper - Retest
ST
1 TERM EXAMINATION –SEPTEMBER 2023-24
COMPUTER APPLICATIONS
CLASS: 9
TIME: 2 hrs. MARKS: 100
(x) How many times the following loop is executed and what is
the output?
int i=1;
while(i<=1) {
i ++;}
System.out.println(i);
(a) Loop is executed 1 time and the output is 2
(b) Loop is executed 1 time and the output is 4
(c) Loop is executed 1 time and the output is 3
(d) Loop is executed 1 time and the output is 1
(xvi) In Java, …………. can only test for equality, whereas ………… can
evaluate any type of boolean expression.
(a) switch, if
(b) if, switch
(c) if, break
(d) continue, if
QUESTION NO 2:-
(i) Write the difference between for loop and while loop.
[2]
(iv) Write the difference between primitive data type and composite
data type.[2]
(vi) What is the difference between the prefix, postfix and infix
notations? [2]
(vii) Write Java expression for T= √ 3 x+ x 2
[2]
Write a menu driven program to perform the following based on the user’s
choice.
(i) Write a program to Accept 2 numbers and find the HCF and LCM of the
numbers.
Example: 16, 24
Factors of 16 = 1, 2, 4, 8, 16
Factors of 24 = 1, 2, 3, 4, 6, 8, 12, 24
Common Factors = 1, 2, 4, 8
HCF = 8
Product of 2 numbers
( Hint: LCM = HCF
)