NEW
Font size
WorksheetsUG Code Breaker Challenge Round-1
Total questions: 30
Worksheet time: 24mins
All keywords in C are in ____________
LowerCase letters
UpperCase letters
CamelCase letters
None of the mentioned
for( ; ; ) leads to
infinite loop
finite loop
error
none of these
int test(a,b)
{
pass
}
What does the "int" in the above block of code signify ?
data type of the function
data type of a and b
return type of the function
arguments of the function
Which of the following is not a format specifier ?
%d
%s
%f
%k
A string should always be enclosed in
single quotes
hashtags
curly brackets
double quotes
Null character is represented by
\n
\t
\0
\r
#include <stdio.h>
int main()
{
int arr[5] = {10,20,30,40,50};
printf("%d",arr[2]);
return 0;
}
What will be the output of the above program ?
10
20
30
error
What is the correct statement by the following
1. # refers to a preprocessor
2. # will not executes a set of statements before main program executes
3. # allows you to create a macros
Both 1 & 2 follows
Both 1 & 3 follows
All 1, 2 & 3 follows
Both 2 & 3 follows
What is the correct statement by the following
In “scanf” & refers to
1.) Address of a memory location
2.) Operator refers to Address
3.) Syntax for scanning a Variable
4.) All the above
Only 1&2 follows
Both 1&3 follows
Only 3 follows
Only 1 follows
What is the output of the following code
#include<stdio.h>
void main()
{
int a,*p;
a=23;
p=&a;
*p=92;
printf(“%d”,++*p);
}
23
93
Compile Time Error
Runtime Error
What is the output of the following code
#include<stdio.h>
void fun()
{
int x=9;
printf(“%d ”,x++);
}
void main()
{
fun();
fun();
fun();
}
10 10 10
10 11 12
9 9 9
9 10 11
What is the output of the following code
#include<stdio.h>
union MyUnion
{ char c[8]; int a,b; float f;
};
typedef union MyUnion MU;
void main()
{
MU u;
clrscr();
printf("%d",sizeof(u));
getch();
}
8
Compile Error
4
Garbage Value
Almost all programming languages start arrays at ___
index 0
index 1
index 2
the null character
Which of these is not a data structure?
Stack
Array
Integer
List
Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, get the total number of element present in stack is
1
2
3
4
The maximum degree of any vertex in a simple graph with n vertices is
a.n–1
b.n+1
c.2n–1
d.n
What is a hash table?
a) A structure that maps values to keys
b) A structure that maps keys to values
c) A structure used for storage
d) A structure used to implement stack and queue
Which of the following is not a technique to avoid a collision?
a) Make the hash function appear random
b) Use the chaining method
c) Use uniform hashing
d) Increasing hash table size
Find the output
class Test {
public static void main(String args[]) {
int arr[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}
Compile error
Exception
Garbage Value
Garbage Value
0
0
float myFloatNum = 5.99f;
System.out.println(myFloatNum);
What will be the output?
5.99
5.99f
"5.99"
"5.99"f
Which keyword is used to define a constant in a programming language?
final
static
const
constant
What is the result when a student, Avni, is given a test and asked to solve the following problem?
int num = 10; System.out.println(num++);
10
11
0
error
What is the output of the following scenario?
John has 10 apples. If he has exactly 10 apples, he will say "Yes", otherwise he will say "No".
Yes
No
True
False
Which of the following option leads to the portability and security of Java?
Bytecode is executed by JVM
The applet makes the Java code secure and portable
Use of exception handling
Dynamic binding between objects
Evaluate the following Java expression,
if x=3, y=5, and z=10:
System.out.println((++z + y - y + z + x++));
24
23
20
25
What will be the output of the following program?
public class Test {
public static void main(String[] args) {
int count = 1;
while (count <= 15) {
System.out.println(count % 2 == 1 ? " *** " : " +++++ ");
++count;
} // end while
} // end main
}
15 times ***
15 times +++++
8 times *** and 7 times +++++
Both will print only once
A. Compile Time Error
B. It will print 'Show'
C. No Output
D. Runtime Error
A. Compile Time Error
B. It will print 'A'
C. It will print 'AB'
D. It will print 'BA'
A. Compile Time Error
B. It will print 'Show1'
C. No Output
D. Runtime Error
