You are on page 1of 2

ANNEXURE-1

Standard Template for Academic Tasks (22231)

1 2 3 4 5

Faculty UID-26121 Faculty name:- Dr. Om Prakash Yadav


Academic Task Number: Test-1 Course code: CSE310
Date of allotment: 5-02-2023 Course title: Programming in Java
Date of submission: 18-02-2023 Maximum Marks: 30(10 MCQ + 20 Code)
Academic Task Type: MCQ and Code Based Test Section:- K21GR

Registration No: _________________ Name: _________________________


Question Question Statement Course Bloom’s Marks per
Number Outcome level Question
1 What will be the output of the following code snippet? CO2 L2: 2
int x = 5, y = 3, z = 1; Understand
while (x++ != --y || --z > x++);
if (++x > z--) y++;
if (--x < ++z) y++;
System.out.println(""+x+y+z);

A. 433 B. 334 C. 343 D. None of These

2 Given a 2-D Array: CO 1 L4 Analyze 2

int [][] arr = {{2, 3}, {5, 2, 4}, {3}, {4, 2, 5}};

Which of the following statement will print an EVEN value?

A. System.out.print(arr[arr[2][1]] [arr.length-1]);
B. System.out.print(arr[arr[2][1]] [1]);
C. System.out.print(arr[arr[2].length] [arr[1].length]);
D. None of These

3 What will be the output of the following program? CO 2 L4: Analyze 2


class Test {
static int x = 5;
static { x %= 3; }
Test() { x = x >> 1; }
{ x *= 3; }
public static void main (String [] rk) {
Test t = new Test();
System.out.print(x);
}
}
A. 2 B. 5 C. 8 D. 3

Page 1 of 2
ANNEXURE-1
Standard Template for Academic Tasks (22231)

4 Consider the following program and identify the output CO 2 L1: 2


class Demo { Understand
public static void main(String args[]) {
int A[]={0,1,2};
for(int i=0;i<A.length;i++)
A[i]=A[(A[i]+3)%A.length];
for(int i=0;i<A.length;i++)
System.out.print(A[i]);
}
}
A. 210
B. 120
C. 102
D. 012
5 What is the c value ? CO 2 L4: Analyze 2
class Demo {
public static void main(String args[]) {
int a=15,b=8;
int c=a+(a>6?++b:--b);
System.out.print(c);
}
}

A. 23
B. 24
C. 25
D. 26

Page 2 of 2

You might also like