Thursday, 9 November 2017

Variables Questions in C

--------------------------------------------------------------------------------------------------------
Next Page                    Home                   Last Page
---------------------------------------------------------------------------------------------------------

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
----------------------------------------------------------------------------------------------------------------
Next Page                  Home                         Last Page
----------------------------------------------------------------------------------------------------------------

More Imp Topics:


100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...