Every function must return a value
Answer: B
No, If a function return type is declared as void it cannot return any value.
Enter details here
Can variable i be accessed by functions in another source file?
int i;
int main()
{
printf("%d\n", i);
}
Answer:
Enter details here
If return type for a function is not specified, it defaults to int
Answer: A
True, The default return type for a function is int.
Enter details here
Which of the following is true for static variable?
Answer: C
No answer description available for this question.
Enter details here
What is the notation for the following functions?
1. int f(int a, float b)
{
/* Some code */
}
2. int f(a, b)
int a; float b;
{
/* Some code */
}
Answer: C
KR Notation means Kernighan and Ritche Notation.
Enter details here
functions can return enumeration constants in c?
Answer: A
No answer description available for this question.
Enter details here
What is the output of this code having void return-type function?
void foo()
{
return 1;
}
void main()
{
int x = 0;
x = foo();
printf("%d", x);
}
Answer: D
No answer description available for this question.
Enter details here
The output of the code below is
int *m();
void main()
{
int k = m();
printf("%d", k);
}
int *m()
{
int a[2] = {5, 8};
return a;
}
Answer: D
No answer description available for this question.
Enter details here
Maximum number of arguments that a function can take is 12
Answer: B
No, C can accept upto 127 maximum number of arguments in a function.
Enter details here
What is the output of this C code?
static int x;
void main()
{
int x;
printf("x is %d", x);
}
Answer: B
No answer description available for this question.
Enter details here