Functions in C Programming MCQ (Multiple Choice Questions And Answers)
Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:
List of Programming Full Forms
- Library Function
- Both A and C
- User defined function
- None of the above
#include <stdio.h>
enum m{JAN, FEB, MAR};
enum m foo();
int main()
{
enum m i = foo();
printf("%d\n", i);
}
int foo()
{
return JAN;
}
- Compile time error
- Runtime error
- 1
- 0
- Generated
- Inherited
- Spawned
- All of the above
int myshow(int);
void main()
{
int a=10;
myshow(a);
myshow(&a);
}
int myshow(int b)
{
printf("Received %d, ", b);
}
- Received 10, Received RANDOMNumber,
- Received 10, Received 10,
- Received 10, Received RANDOMNumber, with a compiler warning
- None of the above
- Pass By Value copies the variable value in one more memory location.
- Pass By Value does not use Pointers.
- Pass By Value protects your source or original variables from changes in outside functions or called functions.
- All of the above