![]() |
VOOZH | about |
Question 1
Question 2
Question 3
Choose the correct statement w.r.t. above C program.
malloc() for ppInt1 and ppInt2 isn’t correct. It’ll give compile time error.
free(*ppInt2) is not correct. It’ll give compile time error.
free(*ppInt2) is not correct. It’ll give run time error.
No issue with any of the malloc() and free() i.e. no compile/run time error.
Question 4
Pick the best statement for the above C program snippet.
Assigning (void *)0 to pVoid isn’t correct because memory hasn’t been allocated. That’s why no compile error but it'll result in run time error.
Assigning (void *)0 to pVoid isn’t correct because a hard coded value (here zero i.e. 0) can’t assigned to any pointer. That’s why it'll result in compile error.
No compile issue and no run time issue. And the size of the void pointer i.e. pVoid would equal to size of int.
sizeof() operator isn’t defined for a pointer of void type.
Question 5
Consider the following variable declarations and definitions in C
Choose the correct statement w.r.t. above variables.
Both i) and iii) are valid.
Only i) is valid.
Both i) and ii) are valid.
All are valid.
Question 6
Let x be an integer which can take a value of 0 or 1. The statement if(x = =0) x = 1; else x = 0; is equivalent to which one of the following?
x = 1 + x;
x = 1 - x;
x = x - 1;
x = 1 % x;
Question 7
A program attempts to generate as many permutations as possible of the string, 'abcd' by pushing the characters a, b, c, d in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT be generated using this program?
abcd
dcba
cbad
cabd
Question 8
Question 9
After hitting the continue; statement in all the loops, the next expression to be executed would be controlling expression (i.e. i < 10) in all the 3 loops.
There are 9 questions to complete.