Font size
WorksheetsTechno Excellent
Total questions: 40
Worksheet time: 21mins
What will be the output of given python code
0
1
2
4
5
6
1
2
4
5
0
1
4
5
1
2
4
5
6
Predict the output of following Python Program.
Error
GeeksforGeeks + 13
GeeksforGeeks+13
13 + GeeksforGeeks
What will be the output of following python code
1:1
3:3
1:10
2
3
Look at given python code. What will it give?
[True, 50, 5, 10] Sum is: 66
TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’
[True, 50, 10, 5] Sum is: 66
[True, 50, 5, 10] Sum is: 65
which is the correct option for following python code?
int1 = 0b0010
print(int1)
0b0010
NameError: name '0b0010' is not defined
SyntaxError
2
What is the right way to split given string in Python?
text = 'Python is a fun programming language'
print(text.split('Python is a fun programming language'))
text.split("")
split(text)
print('text')
print(text.split(' '))
learn the following python code. What will be the output?
list1[0]: Physic
list1[0]:chemistry
list1[0]:['chemistry',1997]
list2[1:5]2,3,4,5
list1[0]: physics
list1[0]: 1997
list1[-2]: ['chemistry', 1997, 2000]
list2[1:5]: [2, 3, 4, 5]
list1[0]: Physic
list1[0]:chemistry
list1[0]:[chemistry,1997]
list2[1:5]:1,2,3,4,5
list1[0]: Physic
list1[0]:chemistry
list1[0]:[chemistry,1997,2000]
list2[1:5]:[1,2,3,4,5]
How will you open file for reading as a text file in python?
please select two correct answer.
open('file.txt')
open('file.txt','r')
open('file.txt','w')
open('file.txt','b')
What is the output of following C program?
1 1
2 2
2 1
1 2
2 2
1 1
1 2
2 1
Which of the following is invalid variable name in C language?
Abc_123
_123
1abc_
_abc_123
What does the above program print?
6 5 5
6 6 5
6 5 6
5 6 6
The output of following C code is-
The power of C
The power of C
Simply C
Error as case labels and switch expressions are not integer constant
Simply C
The value of i printed in above C code is (a) .
(Give exact answer only)
A string constant is a one-dimensional array of characters terminated by ____.
'#'
'/0'
'\0'
'$'
Following data types are available in C language.
(multiple options can be selected)
double, int, float
short, long
signed, unsigned
char, string
Select correct output to be printed by above C code. The strcmp() function returns a positive value when the first string is lexicographically greater than the second string.
-1 0
1 0
0 -1
1 1
K4 and Q3 are graphs with the following structures. Which one of the following statements is TRUE in relation to these graphs?
K4 is planar while Q3 is not
Both K4 and Q3 are planar
Q3 is planar while K4 is not
Neither K4 not Q3 is planar
In any undirected graph, the sum of degrees of all the nodes
Must be even
Is twice the number of edges
Must be ODD
Need not be EVEN
A tree with n nodes has (a) edges.
Symmetric difference of sets A and B is____. (u is union and n is intersection.)
(A-B) U (B-A)
(A U B) - (A n B)
(A-B) n (B-A)
(A n B) - (A U B)
If the size of the stack is 10 and we try to add the 11th element in the stack then the condition is known as___
Underflow
Garbage collection
Overflow
None of the above
Which data structure is mainly used for implementing the recursive algorithm?
Queue
Stack
Binary tree
Linked list
Consider the following stack implemented using stack.
#define SIZE 11
struct STACK
{
int arr[SIZE];
int top=-1;
}
What would be the maximum value of the top that does not cause the overflow of the stack?
8
9
11
10
Which one of the following is the correct way to increment the rear end in a circular queue?
rear =rear+1
(rear % max) + 1
(rear+1) % max
None of the above
JDK stands for ____.
Java development kit
Java deployment kit
JavaScript deployment kit
None of these
which one of the following is a legal deceleration of a two- dimensional array of integers in java
int[] a[] = new int[5][];
int[5][5] a = new int[][];
int a = new int[5,5];
int[][] a = new int[][5];
which interface needs to be implemented in order to make an object seralized in java
clonnable
remote
seralizable
none of the above
superclass of all classes representing the output stream of characters is -------------
OutputStream
Reader
InputStream
Writer
which of this class is used by character streams for reading data from buffer
BufferReader
InputStreamReader
FileReader
FileInputStream
which one of these events will cause the thread to die?
on calling the sleep() method.
when the execution of the run() method ends
when the execution of the start() method ends
on calling the wait() method
Java is a
Procedure Oriented Language
Structure Oriented Language
Object_Oriented Language
Machine Language
A ___________ file is created after successful compilation of a Java program.
Object file
Array file
Class file
String file
Java is
Machine dependent language
Machine independent language
_________ operator returns the remainder after division
+
/
%
*
Operator used to access the members of a class /package
(.) Dot
(,) Comma
{1=C, 2=JavaEE, 4=Python, 3=PHP}
{1=C, 2=JavaSE, 3=Python, 4=PHP}
{1=C, 2=JavaEE, 3=Python, 4=PHP}
{1=C, 2=JavaSE,2=JavaEE, 3=Python, 4=PHP}
NullPointerException
{null=null, a=null, b=JavaSE, c=PHP, d=Python}
{a=null, b=JavaSE, c=PHP, d=Python}
{b=JavaSE, c=PHP, d=Python}
Compilation Fails
Find Output.
{"Computer", "Programming","Networks","null"}
{"Computer", "Programming","Networks",null,"null"}
Line 11 : Genetates NullPointer Exception
Line12: Generates NullPointerException
List all arguments that exist in this program segment:-
double point, String student
point, student
name, mark
name[i], mark[i]
Fix the error by replacing with the correct java statement.
void Status(String student, double point)
void Status ( name[i], mark[i] )
int Status(String student, double point)
void Status ( String name[i], double mark[i] )
