Sail E0 Webinar

MCQs

Total Questions : 18 | Page 2 of 2 pages
Question 11. Which of the following is a complete function?
  1.    int funct();
  2.    int funct(int x) { return x=x+1; }
  3.    void funct(int) { printf(“Hello"); }
  4.    void funct(x) { printf(“Hello"); }
  5.    None of these
 Discuss Question
Answer: Option B. -> int funct(int x) { return x=x+1; }
Question 12. What will be printed when this program is executed?
int f(int x)
{
if(x
  1.    4 5 6 7
  2.    1 2 3 4
  3.    4
  4.    Syntax error
  5.    Runtime error
 Discuss Question
Answer: Option C. -> 4
Question 13. The recursive functions are executed in a ...........
  1.    Parallel order
  2.    First In First Out order
  3.    Last In First Out order
  4.    Iterative order
  5.    Random order
 Discuss Question
Answer: Option C. -> Last In First Out order
Question 14. The function scanf() returns .........
  1.    The actual values read for each argument.
  2.    1
  3.    0
  4.    The number of successful read input values.
  5.    ASCII value of the input read.
 Discuss Question
Answer: Option D. -> The number of successful read input values.
Question 15. Functions have ..........
  1.    Local scope
  2.    Block scope
  3.    File scope
  4.    Function scope
  5.    No scope at all
 Discuss Question
Answer: Option C. -> File scope
Question 16. Which of the following function calculates the square of 'x' in C?
  1.    sqr(x)
  2.    pow(2, x)
  3.    pow(x, 2)
  4.    power(2, x)
  5.    power(x, 2)
 Discuss Question
Answer: Option C. -> pow(x, 2)
Question 17. When a function is recursively called all the automatic variables are stored in a ..........
  1.    Stack
  2.    Queue
  3.    Array
  4.    Linked list
  5.    Register
 Discuss Question
Answer: Option A. -> Stack
Question 18. Char* myfunc(char *ptr)
{
ptr+=3;
return(ptr);
}
void main()
{
char *x, *y;
x = "EXAMVEDA";
y = myfunc(x);
printf("y=%s", y);
}
What will be printed when the sample code above is executed?
  1.    y=EXAMVEDA
  2.    y=MVEDA
  3.    y=VEDA
  4.    y=EDA
  5.    y=AMVEDA
 Discuss Question
Answer: Option B. -> y=MVEDA

Latest Videos

Latest Test Papers