Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

TCS17 06T

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

FACE TCS17-06T

TEST CODE : TCS17-06T


Total number of question : 10
Test duration (min) : 20 min
Correct attempt (mark) :1
Wrong attempt (mark) : Nil

TECHNICAL a. Queue b. Stack c. Tree d. Linked List

Certain questions are self-explanatory. Thus detailed Answer: B


solutions are provided only wherever required.
Explanation:
1. What will be the output of the below program? Stacks can check equal pair/ balanced pair of
parenthesis efficiently. Whenever we get an opening
parenthesis we can push it on the stack and when we
get the corresponding closing parenthesis, we can pop
it.
After performing all push and pop operations, if at the
end of the expression stack becomes empty then the
expression has a balanced parenthesis

5. Which of the below functions is Not declared in


a. Runtime Error b. Compile Time error
math.h?
c. 1 d. 10
a. pow() b. hex() c. sqrt() d. cos()
Answer: C
Answer: B
Explanation:
Explanation:
scanf returns the number of items successfully read
hex() is not declared in math.h
and not 10. Here 10 is input and scanf reads the 10 and
return 1.
6. What is the best case and worst case complexity of
ordered linear search?
2. Memory allocation using malloc() is done in?
a. O(nlogn), O(logn)
a. static area b. Heap area c. stack area d. disc
b. O(logn), O(nlogn)
c. O(n), O(1)
Answer: B
d. O(1), O(n)
Explanation:
Answer: C
Dynamic memory allocation is done in Heap
Explanation:
3. Comment the output of below two print statements.
Although ordered linear search is better than
Integer x = 10, y = 20, z = 5 print x*y/z+x.
unordered when the element is not present in the
print x*(y/z) +x.
array, the best and worst cases still remain the same,
a. Same output b. Differ by 20
with the key element being found at first position or at
c. Differ by 10 d. Differ by 15
last position.
Answer: A
7. What is the use of void pointer?
a. Pointer that will not return any value
Explanation:
b. Address of any variable of any data type can be
Solving 2 equations, we get 50
assigned
c. Address of void method can be stored
4. The best data structure to check whether an
d. Address of another pointer can be stored
arithmetic expression has balanced parenthesis is a

______________________________________________________________________________________________________
Focus Academy for Career Enhancement Page 1 of 2
FACE TCS17-06T
Answer: B

8. If malloc() fails to allocate the requested memory, it 10. What will be the output of the below program?
returns
a. Null b. Garbage Value
c. Zero d. None of the Mentioned

Answer: A

Explanation:
If malloc() fails to allocate memory, it will return Null

9. Which of the following is the correct order of


evaluation for the below expression? z = x + y * z / 4 %
2-1
a. * / % + - = b. * / % + -=
a. 3 8 b. 8 3 c. 8 5 d. 8
c. / * % - + = d. * % / - + =
Answer: B
Answer: A
Explanation:
Explanation:
Initially x = 3 then it calls the m() function then x = 8
It executes based upon operator precedence
and n() function print the x value and return to main
function. Scope of x variable in m() function only for
that function.

______________________________________________________________________________________________________
Focus Academy for Career Enhancement Page 2 of 2

You might also like