C Functions Questions and Answers
Practice ModeShowing 10 of 151 questions
Q41
Char var1 [10];
char var2 [5] = "Angel";
strcpy (var1, Var2);
What will happen when the above code is executed ?
Answer: Option D
Q42
void display (????)
{
printf(%d\n, list [1] [0]);
}
int main ( )
{
int ary [2] [2] = (1, 2, 3, 4);
display (void * ) ry );
return 0;
}
Which of the following when substituted for the ???? above, will NOT correctly print out the number 3?
Answer: Option D
Q43
What does strncat append to the target string after the specified number of characters have been copied ?
Answer: Option C
Q44
INT STRCMP (S1, S2) compares strings s1 and s2 and
Answer: Option A
Q45
int func ( char *sv)
{
static char info [ ] = "If anything can go wrong , it will"; ????
}
from the sample above, which of the following could replace the ???? to correctly copy text from info into the passed buffer without any illegal memory accesses ?
Answer: Option C
Q46
return (x = (((y = 2) *z + ((a|b) * (2+s)))));
Which of the following expressions use he minimum number of parentheses and is equivalent to the expression above ?
Answer: Option B
Q47
When a function is recursively called all automatic variables are
Answer: Option A
Q48
main ( )
{
int n = 10;
fun (n);
}
int fun ( int n)
{
int i;
for (i=0, i<=n; i++)
fun (n-i);
printf(" Kodeeswaran");
}
How many times is the printf statement executed for n=10?
Answer: Option C
Q49
C allows
Answer: Option A
Q50
main ( )
{ }
int a ;
f1 ( ) { }
f2 ( ) { }
Two which of the above function, is int a available for ?
Answer: Option D