ExamVeda
Login
Home
41
Which of the following is a complete function?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
42
What will be printed when this program is executed?
int f(int x)
{
   if(x <= 4)
      return x;
   return f(--x);
}
void main()
{
   printf("%d ", f(7)); 
}
Discuss
Answer & Solution
Answer: Option C
Solution:

In this recursive function call the function will return to main caller when the value of x is 4. Hence the output.

43
The recursive functions are executed in a ...........
Discuss
Answer & Solution
Answer: Option C
Solution:
Because for each function call an entry is created in stack frame( known as Active Record Instance), and are executed in LIFO manner.
44
The function scanf() returns .........
Discuss
Answer & Solution
Answer: Option D
Solution:

According to the prototype, the return type of scanf( ) function is int, that is the number of successful read input values.

45
Functions have ..........
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
46
Which of the following function calculates the square of 'x' in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
47
When a function is recursively called all the automatic variables are stored in a ..........
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
48
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?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
49
What will be the output of the following C code?
#include <stdio.h>
#define foo(x, y) #x #y
int main()
{
    printf("%s\n", foo(k, l));
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
50
What will be the output of the following C code?
#include <stdio.h>
double var = 8;
int main()
{
    int var = 5;
    printf("%d", var);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board