What will be the output?
double var = 8;
int main()
{
int var = 5;
printf("%d", var);
}
Answer: A
No answer description available for this question.
Enter details here
Automatic variables:
Answer: D
No answer description available for this question.
Enter details here
Automatic variables are allocated memory in?
Answer: D
No answer description available for this question.
Enter details here
What is the output of this C code?
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf("%d", x);
}
Answer: A
No answer description available for this question.
Enter details here
Which of the following function declaration is illegal?
Answer: D
No answer description available for this question.
Enter details here
Automatic variables are allocated space in the form of a:
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
int x = 5;
void main()
{
int x = 3;
m();
printf("%d", x);
}
void m()
{
x = 8;
n();
}
void n()
{
printf("%d", x);
}
Answer: A
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("hello ");
printf("%d", k[0]);
}
int *m()
{
int a[2] = {5, 8};
return a;
}
Answer: C
No answer description available for this question.
Enter details here
What is the output of this C code?
int main()
{
void foo();
void f()
{
foo();
}
f();
}
void foo()
{
printf("2 ");
}
Answer: D
Even though the answer is 2, this code will compile fine only with gcc. GNU C supports nesting of functions in C as a language extension where as standard C compiler doesn’t.
Enter details here
What will be the data type returned for the following function?
int func()
{
return (double)(char)5.0;
}
Answer: B
No answer description available for this question.
Enter details here