--------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
1.
The compiler in C ignores all text till the end of line using
A. //
B. /
C. */
D. none of above
Answer: A
-----------------------------------------------------------------------------------------------------------------
2.
To access the members of structure which symbol is used
A. *
B. -
C. ,
D. .
Answer: D
-----------------------------------------------------------------------------------------------------------------
3.
What is the output of this C code?
#include
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf("%d", x);
}
A. 9
B. 4
C. 5
D. 0
Answer: A
----------------------------------------------------------------------------------------------------------------
4.
What is the output of this C code?
#include
double i;
int main()
{
printf("%g\n",i);
return 0;
}
A. 0
B. 0.000000
C. Garbage value
D. Depends on the compiler
Answer: A
---------------------------------------------------------------------------------------------------------------
5.
Which part of the program address space is p stored in the code given below?
#include
int *p;
int main()
{
int i = 0;
p = &i;
return 0;
}
A. Code/text segment
B. Data segment
C. Bss segment
D. Stack
Answer: C
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
More Imp Topics: