Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C PROGRAM QUESTIONS : PART 13

Functions in C are ALWAYS:

Internal 
External 
 Both Internal and External 
External and Internal are not valid terms for functions
SHOW ANSWER

Global variables are:

Internal 
External 
Both (a) and (b)
None of the mentioned
SHOW ANSWER

Which of the following are an external variable?
    int func (int a)
    {
        int b;
        return b;
    }
    int main()
    {
        int c;
        func (c);
    }
    int d;

 d
SHOW ANSWER

What will be the output?
    int main()
    {
        printf("%d", d++);
    }
    int d = 10;

 10 
11
Compile time error
SHOW ANSWER

What will be the output?
    double var = 8;
    int main()
    {
        int var = 5;
        printf("%d", var);
    }

 Compile time error due to wrong format identifier for double 
Compile time error due to redeclaration of variable with same name
SHOW ANSWER

What is the output of this C code?
    double i;
    int main()
    {
       printf("%g\n",i);
       return 0;
    }

0.000000
Garbage value
Depends on the compiler
SHOW ANSWER

Which part of the program address space is p stored in the code given below?
    int *p = NULL;
    int main()
    {
        int i = 0;
        p = &i;
        return 0;
    }

Code/text segment 
Data segment
Bss segment 
Stack
SHOW ANSWER

Which part of the program address space is p stored in the code given below?
    int *p;
    int main()
    {
        int i = 0;
        p = &i;
        return 0;
    }

Code/text segment 
Data segment
Bss segment 
Stack
SHOW ANSWER

Can variable i be accessed by functions in another source file?
    int i;
    int main()
    {
        printf("%d\n", i);
    }

false 
Only if static keyword is used 
 Depends on the type of the variable
SHOW ANSWER

Property of external variable to be accessed by any source file is called by C90 standard as:

external linkage 
external scope 
global scope
global linkage
SHOW ANSWER

What is the output of this C code?
    int *i;
    int main()
    {
        if (i == NULL)
            printf("true\n");
        return 0;
    }

true 
true only if NULL value is 0 
 Compile time error 
Nothing
SHOW ANSWER

What is the output of this C code?
    int *i;
    int main()
    {
        if (i == 0)
            printf("true\n");
        return 0;
    }

true 
true only if NULL value is 0 
Compile time error 
Nothing
SHOW ANSWER

What is the output of this C code?
    static int x = 5;
    void main()
    {
        x = 9;
        {
            int x = 4;
        }
        printf("%d", x);
    }

 4 
 0
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in