Std. IX - Computer Application
Std. IX - Computer Application
Page 1 of 3
17. Which of the following keyword is mandatory with the switch block ?
a) case b) else c) if( ) d) none
18. Which of the following is not an entry controlled loop
a) for b) while c) do-while d) none
19. Which of the following is not a jump statement
a) System .out b) continue c) return d) break
20. The terminating value of variable ‘y’ in given loop will be what
for( y=1 ; y<=7 ; y++)
a) 7 b) 8 c) 6 d) 7.5
Page 2 of 3
b) Convert from while to do-while loop
n= 475;
while(n>0)
{
rem= n%10;
System.out.println(rem);
n= n/10;
}
1) Write a program in Blue java to print Fibonacci series till ‘n’ terms.
(Fibonacci series – 0, 1, 1, 2,3, 5,8,13,21, 34………etc)
Input – 5
Output -
0
1
1
2
3
2) Write a program in Blue java to accept a number and check its an Armstrong number
or not. (Using while loop)
(Example of Armstrong number – 153 )
13 + 5 3 + 3 3
1+ 125 + 27 = 153
3) Write a program in Blue java to accept a number and print sum of all digits of the
number. (Using do-while).
Input - 456
Output- 4+ 5+6 = 15
4) Write a program in Blue java to print sum of following series (Using any loop)
S= 2/4 + 4/ 6 + 6/8 + 8 / 10 + ---------+ n/n+2.
5) Write a program in Blue java to print sum of all even and odd digits separately.
Input – 2963
Output-
Sum of even digits = 8
Sum of odd digits = 12
Page 3 of 3