Question 1 of 25
Hints left: 3
Q1
The recursive functions are executed in a ...........
Q2
What will be the output of the following C code? #include <stdio.h> int x = 5; void main() { int x = 3; printf("%d", x); { x = 4; } printf("%d", x); }
Q3
In C, what is a function parameter's scope?
Q4
What will be the output of the following C code? #include <stdio.h> int x; void main() { printf("%d", x); }
Q5
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; }
Q6
What will happen after compiling and running following code? main() { printf("%p", main); }
Q7
Which of the following is a complete function?
Q9
The default parameter passing mechanism is
Q10
What is the result of compiling and running this code? main() { char string[] = "Hello World"; display(string); } void display(char *string) { printf("%s", string); }
Q12
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?
Q13
What will be the output of the following program code? main() { static int var = 5; printf("%d ", var--); if(var) main(); }
Q14
What will be the output of the following C code? #include <stdio.h> double var = 8; int main() { int var = 5; printf("%d", var); }
Q15
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)); }
Q17
Which of the following function calculates the square of 'x' in C?
Q18
What would happen if you create a file stdio.h and use #include "stdio.h"?
Q19
When a function is recursively called all the automatic variables are stored in a ..........
Q20
Determine output: main() { int i = 5; printf("%d%d%d%d%d", i++, i--, ++i, --i, i); }
Q21
Pick the correct statements. I. The body of a function should have only one return statement. II. The body of a function may have many return statements. III. A function can return only one value to the calling environment. IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.
Q22
Functions have ..........
Q23
The function scanf() returns .........
Q24
Which part of the program address space is p stored in the following C code? #include <stdio.h> int *p = NULL; int main() { int i = 0; p = &i; return 0; }
Q25
Determine output: main() { int i = abc(10); printf("%d", --i); } int abc(int i) { return(i++); }