Font size
Worksheetstechnical round
Total questions: 90
Worksheet time: 45mins
What is the output of this statement "printf("%d", (a++))" ?
The value of (a + 1)
The current value of a
Error message
Garbage
In the C language, the constant is defined _______.
Before main
After main
Anywhere, but starting on a new line.
None of the these.
How many times will the following loop execute?
for(j = 1; j <= 10; j = j-1)
Forever
Never
0
1
Which one of the following is a loop construct that will always be executed once?
for
while
switch
do while
What will the result of len variable after execution of the following statements?
int len;
char str1[] = {"39 march road"};
len = strlen(str1);
11
12
13
14
Which statement can print \n on the screen?
printf("\\n");
printf("n\");
printf("n");
- printf('\n');
C is _______ type of programming language ?
Object Oriented
Procedural
Bit level language
Functional
C language was invented to develop which Operating System?
Android
Linux
Ubuntu
Unix
A pointer is a memory address. Suppose the pointer variable has p address 1000, and that p is declared to have type int*, and an int is 4 bytes long. What address is represented by expression p + 2?
1002
1004
1008
1006
How many bytes does "int = D" use?
0
1
2 or 4
8
void main()
{
int color=2;
switch(color)
{
case 0: printf("black");
case 1: printf("blue");
case 2: printf("Green");
case 3: printf("aqua");
default:printf("other");
}
}
(a)
Which of the function cannot be a structure member?
Another structure
Function
Array
None
Which of the following is an invalid assignment operator?
A%=10;
A/=10;
A|=10
none
6
7
8
9
find output
22
23
24
25
void main()
{
int color=2;
switch(color)
{
case 0: printf("black");
case 1: printf("blue");
case 2: printf("Green");
case 3: printf("aqua");
default:printf("other");
}
}
(a)
C++ is a _______ programming language
Structured Query Language
Scripting language
Procedural
Object Oriented
Which of the following is not an OOPS concept?
Encapsulation
Pointers
Inheritance
Polymorphism
//What is the value of a in below program?
int main()
{
int a, b=45;
a = 90/b;
return 0;
}
90
2
45
0
Exception handling in C++ is used to handle
Runtime Errors
Logical Errors
Syntax Errors
Compilation error
One of the following functions is not used with Python String
Split
Remove
Replace
Choose the correct syntax of the split function:
x.split[]
split(x)
x.split(",", 3)
X.SPLIT(",", 3)
Choose the correct syntax of the replace function:
x.Replace(x)
x.replace(y)
x.replace(3,x)
x.replace("j","3")
Choose the correct code to print line of 10 stars using repetition operation:
print("**********")
print("*"*10)
print("*"^10)
print("*"+10)
The correct syntax of the len function for string x:
x.len()
len[x]
LEN[]
len(x)
The correct syntax for converting the string x to uppercase is :
X.upper()
upper(x)
x.UPPER[ ]
x.upper()
The correct syntax for converting the string myname to lowercase is :
myNAME.lower[ ]
myname.lower( )
myname.upper( )
myname_lower(12 )
To remove the spaces present at start and end of the string, you can use
split()
len()
strip()
remove()
Let x= "Python", the output of print(x.upper()) is
python
PYTHON
_PYTHON
"PYTHON"
Let x= "java", the output of Print(x.replace("j","L") ) is
LAVA
Error
lava
Lava
Let x= "python is a high level language", the output of print(x[5].replace("n","*")) is
pytho* is a high level language
python is a high level language
*
Error
Let x= "python is a high level language", the output of print(len(x[-1])) is
1
31
Error
25
Let x= "Python is a high level language", the output of print(x.replace(x[-3],"3")) is
Error
Python is 3 high level l3ngu3ge
Python is a high l3v3l languag3
Python is a high level language
Let x= "Python is a high level language", the output of print(x[7].upper()) is
Python is a high level language
PYTHON IS A HIGH LEVEL LANGUAGE
I
S
Let x= "Python is a high level language", the output of print(x[2].upper()+x[3].lower()+x[-1]) is
THE
The
ThE
the
Let x= "Python is a high level language", the output of print(x[-4].upper()+x[8]+x[-1]) is
Use
Age
USE
Error
Choose the correct python program that has the output 6
print(len("Python"))
Print(len("Python"))
x= "Python"
print(x.replace("Python","6"))
Both a and c
Let x= "Python is a high level language", the output of
print(x.split("i", 2))
['Pyth', 'n is a high level language']
['Python is ', ' high level l', 'nguage']
['Python ', 's a h', 'gh level language']
Error
Let x= "Python", the output of
print(x[0])
print(x[1])
print(x[2])
PYT
P
y
t
T
h
o
n
oh
Let x= "Python", the output of
print(x[0])
print(x[-1])
print(x[-2])
P
N
O
p
O
n
t
h
y
P
n
o
To display something on the screen, use this command:
print()
Print()
screen()
write()
display()
To display the following on screen
Hello World!
the following command should be used:
print(Hello World!)
print("Hello World!")
print("Hello World" + !)
print"(Hello World!)"
name = 'Dave'
print (name)
Which operator performs a division?
-
+
/
*
Which operator checks if a value is equal to another value?
+
=
==
!=
Which operator checks if a value is not equal to another value?
==
+=
!=
=
Which of the following is correct?
Comments are for programmers for better understanding of the program.
Python Interpreter ignores comment.
You can write multi-line comments in Python using triple quotes, either ''' or """.
All of the above
In the following code, n is a/an _______?
n = '5'
integer
string
tuple
operator
What is used to take input from the user in Python?
cin
scanf()
input()
<>
Python language was developed in what year?
1985
2001
1991
1820
Is python an interpreter or compiler programming language?
Compiler
Interpreter
Python is uses braces to block off code
True
False
Python uses indentation to block code into chunks
True
False
Python correct naming convention for constants is?
firstName
First_Name
FIRST_NAME
firstname
Python correct naming convention for variables is?
new_user25
NewUser25
25_new_user
25NewUser
NEWUSER25
What output will the console show, if 15 and 30 are entered by the user?
Syntax error
The sum of the two numbers - 45
The concatenation of the two numbers - 1530
Complier error
What result will display in the shell if 15 and 20 is entered by the user?
"num1 + num2"
1520
35
What datatype will the answer be if the user enters 15 and 30?
Integer
String
Boolean
Float
Which one will display when this code is run?
A: Good morning.______________________?
B: It is eight o'clock.
What time do you go to school?
When do you play soccer?
What time is it?
How do you go to school?
I have been living in Madrid ......
since ten years.
ten years ago.
for ten years.
ten years.
This is the ...... thing I have ever done.
harder
hardest
hard
more hard
Have you finished with the newspaper ......
still?
already?
now?
yet?
If I want to pass my exam, I ...... study harder.
will have to
would have to
had to
want to
Michael is ............ his sister.
not so clever than
not as clever than
not as clever as
not so clever as
...... people eat healthy food.
Very little
Very less
Very least
Very few
Choose the correct sentence
We told him going to the doctor.
We told him to go to the doctor.
We told him he go to the doctor.
We told that he goes to the doctor.
He hasn't got ......time for a coffee.
many
few
a lot
much
She's married to a doctor, doesn't she?
Correct sentence
Incorrect sentence
The duty of the lighthouse keeper is to keep the light burning no matter what happens, so ships will be warned of the presence of dangerous rocks. If a shipwreck should occur near the lighthouse, even though he would like to aid in the rescue of it's crew and passengers, the lighthouse keeper must....
Stay at his light
Rush to their aid
turn out the light
quickly sound the siren
In certain areas, water is so scarce that every attempt is made to conserve it. For instance, on one oasis in the Sahara Desert, the amount of water necessary for each date palm is carefully determined. How much water is each tree given?
No water at all
Exactly the amount required
Water only if it is healthy
Water on alternate days
Twenty-five percent of all household burglaries can be attributed to unlocked windows or doors. Crime is the result of opportunity plus desire. To prevent crime, it is each individual's responsibility to ....
Provide the opportunity
Provide the desire
prevent the opportunity
prevent the desire
From a building designer's standpoint, three things make a home livable are the client, the building site and the amount of money the client has to spend. According to the passage, to make a home livable......
The prospective piece of land makes little difference
It can be built on any piece of land
The design must fit the owner's income and site
The design must fit the designer's income
A business letter has six parts instead of five. The extra part is called the inside address. It is placed just above the salutation. The other five parts are just the same as for the friendly letter.
What is the extra part of the business letter?
The salutation
A friendly letter
The inside address
The six parts instead of five
