C- Functions Question and Answer
C- Functions Question and Answer
91. Find the output
void main ( )
{
bbsr ( )
{
printf("bbsr");
ctc ( )
{
printf("ctc");
}
}
printf("puri');
}
void main ( )
{
bbsr ( )
{
printf("bbsr");
ctc ( )
{
printf("ctc");
}
}
printf("puri');
}
- puri
- bbsrctcpuri
- bbsrctc
- Compilation error
92. Which header file must be included to work with dynamic function variables?
- stdio.h
- stdarc.h
- stdarg.h
- stddyn.c
93. A function type is said to be derived from its return type and if its return type is T, The function type is sometime called
- function returing T
- Function type derivation'
- Function prototype
- None
94. Parameters are used
- To return values from the called function
- to send values from the calling function.
- To specify the data type of the return value.
- Both options a & b.
95. Find the output
void main ( )
{
int a=5;
a=find (a+=find (a++);
printf("%d",a);
}
int find (int a)
{
return ++a;
}
void main ( )
{
int a=5;
a=find (a+=find (a++);
printf("%d",a);
}
int find (int a)
{
return ++a;
}
- 12
- 13
- 15
- None of these
96. Find the output.
void main ()
{
int i=65536;
if (i)
callme ( );
else
callyou ( );
}
callme ( )
{
printf("Bye");
}
callyou ( )
{
printf ("welcome");
}
void main ()
{
int i=65536;
if (i)
callme ( );
else
callyou ( );
}
callme ( )
{
printf("Bye");
}
callyou ( )
{
printf ("welcome");
}
- Bye
- Welcome
- Error, integer constant out of bound
- None of these
97. Find the output
void main ( )
{
int a=4, b=5;
printit (a,b);
}
printit (int b, int a)
{
printf("%d %d", a, b);
{
int a=0;
int b=1;
printf("%d %d",a,b);
}
}
void main ( )
{
int a=4, b=5;
printit (a,b);
}
printit (int b, int a)
{
printf("%d %d", a, b);
{
int a=0;
int b=1;
printf("%d %d",a,b);
}
}
- 4 5 0 1
- 5 4 0 1
- 5 5 0 0
- None of these
98. What is the difference between writing prototype inside a function and outside a function?
- The prototype declared above main has more priority than inside the main.
- The prototype declared inside the main has more priority than above the main.
- The prototype define inside the main then call is only from main() method.
- None of these
99. Consider the printf statement used as below:
printf("%d %d", f1 ( ), f2 ( );
/*Assume f1 and f2 as functions
returning int*/
Then the order in which the functions f1 and f2
are called is :
printf("%d %d", f1 ( ), f2 ( );
/*Assume f1 and f2 as functions
returning int*/
Then the order in which the functions f1 and f2
are called is :
- Left to right.
- Right to left
- Dependent on compiler/implementation
- None of these
100. ANSI C supports three kinds of function, such as user defined function, standard library function and
- System call function
- Derived function
- Inter service routines
- None of these