PLA 1004 Set 2
PLA 1004 Set 2
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.
Name :
Invigilator Signature
PAGE \* MERGEFORMAT 8
Instructions:
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.
c. java.lang.Short d. java.lang.StringBuilder
In java, which method is used to read a word value from user? 1
16 a. next() b. nextLine() c. chatAt() d. read()
What is the range of int data type in Java? 1
17 a. -128 to 127 b. -32768 to 32767 c. 0 to 256 d. None
Which of the following are legal statements in java code?
1. int w = (int)888.8;
2. byte x = (byte)100L; 1
18 3. long y = (byte)100;
4. byte z = (byte)100L;
a. 1 and 2 b. 2 and 3 c. 1, 3 and 4 d. All statements are correct
What is the output of given code?
double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5};
double result = 0;
1
19 for (int i = 0; i < 6; ++i)
result = result + num[i];
System.out.print(result/6);
a. 16.46666666666667 b. 16.34 c. 16.46 d. 16.566666644
What will be the output of code?
1
20 int n = 10; System.out.print((n<<1) + (n>>1));
a. 25 b. 40 c. 10 d. 200
What is the time complexity of code?
1
21 for (int i = 1; i <= n; i++) {System.out.println(n)}
a. O (log n) b. O (n log n) c. O(n) d. O(nlog(log n))
22 What is the time complexity of code? 1
int a = 0, b = 0;
for (i = 0; i < N; i++) {a = a + Math.random();}
for (j = 0; j < M; j++) {b = b + Math.random();}
PAGE \* MERGEFORMAT 8
Instructions:
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.
PAGE \* MERGEFORMAT 8
Instructions:
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.
PAGE \* MERGEFORMAT 8