NEW
Font size
WorksheetsAIASA Code Rewind
Total questions: 24
Worksheet time: 16mins
Switch Statement
Is a statement with a set of conditions called cases
Is a case
Is a condition with no cases
Is a boolean statement
Which of the following are correct file opening modes in C?
r
rb
w
All of the above
cstdlib
Can convert a number into a letter
It doesn't have any use
Is the same as iostream
Can convert a number into absolute number
ctime
Manipulates your CPU
Manipulates other libraries
Manipulates date and time information
It just counts
For a random number generator, you write it as
sin()
rand()
cos()
abs()
If p is an integer pointer with a value 1000, then what will the value of p + 5 be?
1004
1020
1005
1015
What is the disadvantage of arrays in C?
the amount of memory to be allocated needs to be known beforehand.
Elements are stored in contiguous memory blocks
Elements can be accessed in constant time
None
Which of the following is NOT a logical operator in C++ language?
&
&&
||
!
If originally x=2,y=0, and z=1, what is the value of x, y, and z after executing the following code?
if (x>y)
y=x;
else
z=x;
x=2 y=2 z=1
x=0 y=2 z=0
x=2 y=1 z=1
x=2 y=0 z=1
what is the o/p?
0
5
-5
10
A function can have _____ inside the parenthesis
loops
Arguments/Parameters
Braces
Types
what will be the output of the given code?
3 3
3 5
5 3
5 5
A function that is not void needs to have a _____ _______
variable calculation
printing statement
Return statement
cout statement
The #include <stdio.h> is a ______________.
Inclusion directive
File inclusion directive
Preprocessor directive
None of the above
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
Out of the following, which one is not valid as an if-else statement?
if ((char) x){}
if (x){}
if (func1 (x)){}
if (if (x == 1)){}
What is the range of values that can be stored by int datatype in C?
-(2^31) to (2^31) - 1.
-256 to 251
0 to (2^31) -1
-256 to 255
Equal strings
There will be a compile error and it will not run
Nothing will be output on the console
None of the above
Do while loops
Runs a statement once
Runs a statement twice
Runs a statement multiple times or not within a boolean condition
Doesn't run at all
What will be the output of the following C code?
3 2 3
2 2 3
3 2 2
2 3 3
What will be the output of the following C code?
Run time error
7
8
Depends on compiler
What will be the output of the following C code?
H
H is printed infinite times
Compile time error
Varies
What is the default return type if it is not specified in function definition?
void
int
double
short int
