Skip to content

Tag Archives: C-Functions

Predict the output? #include <stdio.h> int main() {     void demo();     void (*fun)();     fun = demo;     (*fun)();     fun();     return 0; }    void demo() {     printf("GeeksQuiz… Read More
Output of following program? #include<stdio.h>    void dynamic(int s, ...) {     printf("%d ", s); }    int main() {     dynamic(2, 4, 6, 8);     dynamic(3, 6,… Read More
Output? #include <stdio.h>    int main() {     int (*ptr)(int ) = fun;     (*ptr)(3);     return 0; }    int fun(int n) {   for(;n > 0; n--)… Read More
#include <stdio.h> int main() {   printf("%d", main);     return 0; } (A) Address of main function (B) Compiler Error (C) Runtime Error (D) Some random value… Read More
Which of the following is true about return type of functions in C? (A) Functions can return any type (B) Functions can return any type… Read More
In C, parameters are always (A) Passed by value (B) Passed by reference (C) Non-pointer variables are passed by value and pointers are passed by… Read More
Output of following program? #include <stdio.h> int main() {     int i = 5;     printf("%d %d %d", i++, i++, i++);     return 0; } (A) 7 6… Read More
In C, if a function is called before its declaration, the compiler assumes the return type of the function as int.For example, the following program… Read More
Function prototype tells the compiler about a number of parameters function takes data-types of parameters, and return type of function. By using this information, the… Read More
With GCC family of C compilers, we can mark some functions to execute before and after main(). So some startup code can be executed before… Read More
In C++, what is the difference between exit(0) and return 0 ? When exit(0) is used to exit from program, destructors for locally scoped non-static… Read More
C supports variable numbers of arguments. But there is no language provided way for finding out total number of arguments passed. User has to handle… Read More
exit() void exit ( int status );  exit() terminates the process normally. status: Status value returned to the parent process. Generally, a status value of… Read More
It is compiler dependent in C. It is never safe to depend on the order of evaluation of side effects. For example, a function call… Read More
Prerequisite : Static variables in C In C, functions are global by default. The “static” keyword before a function name makes it static. For example,… Read More

Start Your Coding Journey Now!