Font size
WorksheetsIEEE_Round2
Total questions: 13
Worksheet time: 19mins
Type your email address
If M is multiple of 3 and 5 then print "Good Number" (without quotes).; If M is only multiple of 3 and not of 5 then print "Bad Number" ; If M is only multiple of 5 and not of 3 then print "Poor Number"; If M doesn't satisfy any of the above conditions then print "-1"
What's the error in the following code
O!=0 condition is missing
n!=0 condition is incomplete
n==0 should't include O==0 condition
None of the above
We need to find the middle element of the linked list.
But the code we wrote won't compile. What should we change
change the function return value type to Node because the function will return Node
change the p2->next condition as it won't represent a boolean(there is a 0 instead of false)
change the function return value type to void because the function won't return anything
change the p2->next and p1->next condition as it won't represent a boolean(there is a 0 instead of Null)
What's the output
Constructing object number 1
Constructing object number 2
Constructing object number 3
Constructing object number 4
Destructing object number 1
Destructing object number 2
Destructing object number 3
Destructing object number 4
Caught 4
Constructing object number 1
Constructing object number 2
Constructing object number 3
Constructing object number 4
Destructing object number 3
Destructing object number 2
Destructing object number 1
Caught 4
Constructing object number 1
Constructing object number 2
Constructing object number 3
Constructing object number 4
Destructing object number 4
Destructing object number 3
Destructing object number 2
Destructing object number 1
Caught 4
Constructing object number 1
Constructing object number 2
Constructing object number 3
Constructing object number 4
Destructing object number 1
Destructing object number 2
Destructing object number 3
Caught 4
We need to add integers to an array such that if
input=[1,2,0,0],i=5,3 output=[1,2,5,3]
None of the above are correct
We need to add a node in front of linked list.Now which code has the correct implementation
void push(Node** head, int data)
{
Node* new_node = new Node();
new_node->data =data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
void push(Node** head_ref, int data)
{
Node* new_node = int Node
new_node = data;
new_node = (*head_ref);
(*head_ref) = new_node;
}
int push(Node** head_ref, int data)
{
Node* new_node = int Node
new_node = data;
new_node = (*head_ref);
(*head_ref) = new_node;
}
Node push(new Node head_ref, int data)
{
Node* new_node = int Node
new_node = data;
new_node = (*head_ref);
return new_node;
}
We need to find the number of true in an array.
For example in an array[true,true,false,false,true] output will be 3.
So the function will be
None of the above are correct
Which is the best approach to reverse the stack according to the time complexity?
Stack reversal using another stack
Reversing of the stack using recursion
By using a map to store all the stack elements and then reversing it
Reversing a stack without using extra space and reccursion
int main()
{
int x = -1;
char *ptr;
ptr = new char[256];
try {
if( x < 0 )
{
throw x;
}
if(ptr)
{
throw " ptr is NULL ";
}
}
catch (...)
{
cout << "Exception occurred: exiting "<< endl;
exit(0);
}
getchar();
return 0;
}
What will be the output?
Compilation error
Exception occurred: exiting
ptr is Null
ptr is NULL
Exception occurred: exiting
let re = new RegExp('ab+c');
Which of the following will be a match?
(hint '+' = more than 1 char)
abbba+hbbdcac
abacbbacabc
acpgbbaABCn
ABBBABAABBC
This code does not execute properly. Try to figure out why
multiply(int a, int b)
{
a * b;
}
There is no return statement here
it has not defined any return type
its multiplying the numbers wrong
There is a program error in this program
We need to reverse an integer. But only 1 of the following code gives us the correct output.
None can solve the problem
int main()
{
unsigned char a = 5, b = 9;
printf(" %d, %d\n", a, b);
printf(" %d\n", a & b);
}
return 0;}
What will be the output of the program(hint: it is using bitwise operators)
a=5,b=9,a&b=1
5,9,1
5,9
1
5,9,0
