CSE Computer Application - Class X - 2017 PYQ
Table of Content:
Table of Content:
Write a program to accept a number and check and display whether it is a spy number or not. (A number is spy if the sum of its digits equals the product of its digits.)
Example: consider the number 1124.
Sum of the digits = 1 + 1 + 2 + 4 = 8
Product of the digits = 1 x 1 x 2 x 4 = 8
Using switch statement, write a menu driven program for the following:
For an incorrect option, an appropriate error message should be displayed.
Write a program to input integer elements into an array of size 20 and perform the following operations:
/
and %
operator?
Name the operators listed below:
String x[] = {"SAMSUNG", "NOKIA", "SONY", "MICROMAX", "BLACKBERRY"};
Give the output of the following statements:
Name the following:
char ch='t'; res= Character.toUpperCase(ch);
int a,b; for (a = 6, b = 4; a <= 24; a = a + 6) { if (a%b == 0) break; } System.out.println(a);
char ch = 'F'; int m = ch; m=m+5; System.out.println(m + " " + ch);
x1= ++x – x++ + --x
int i = 1; int d = 5; do { d=d*2; System.out.println(d); i++ ; } while ( i<=5);
String s="Today is Test"; System.out.println(s.indexOf('T')); System.out.println(s.substring(0,7) + " " +"Holiday");
What are the values stored in variables r1 and r2:
String A ="26", B="100"; String D=A+B+"200"; int x= Integer.parseInt(A); int y = Integer.parseInt(B); int d = x+y; System.out.println("Result 1 = " + D); System.out.println("Result 2 = " + d);
Analyze the given program segment and answer the following questions:
for(int i=3;i<=4;i++ ) { for(int j=2;j