1. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int __SMALL__ = 11;
        int y;
        y= __SMALL__ < 5;
        printf("%d",y);
        return 0;
    }

    A
    11

    B
    5

    C
    0

    D
    Compilation error

    E
    None of these

    Note: Variable name cannot be global identifier.
    1. Report
  2. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int __BIG__ = 32;
        int y;
        y= __BIG__ && 8;
        printf("%d",y);
        return 0;
    }

    A
    32

    B
    8

    C
    1

    D
    Compilation error

    E
    None

    Note: Variable name can be in the format: __NAME__. But it is bad practice since this format is used for global identifiers.
    1. Report
  3. Question: What will be output of the following c program?
    #include<stdio.h>
    static num=5;
    int num;
    extern int num;
    int main(){
        printf("%d",num);
        return 0;
    }

    A
    5

    B
    10

    C
    0

    D
    Compilation error

    E
    None of these

    Note: Two or more global variables can have same name but we can initialize only one of them.
    1. Report
  4. Question: What will be output of the following c program?
    #include<stdio.h>
    static num=5;
    extern int num;
    int main(){
        printf("%d",num);
        return 0;
    }
    int num =25;

    A
    0

    B
    5

    C
    25

    D
    Compilation error

    E
    None of these

    Note: Two or more global variables can have same name but we can initialize only one of them.
    1. Report
  5. Question: What will be output of the following c program?
    #include<stdio.h>
    static num;
    int main(){
        printf("%d",num);
        return 0;
    }
    int num =25;

    A
    0

    B
    1

    C
    25

    D
    Compilation error

    E
    None of these

    Note: Two or more global variables can have same name but we can initialize only one of them.
    1. Report
  6. Question: What will be output of the following c program?
    #include<stdio.h>
    int xyz=10;
    int main(){
        int xyz=20;
        printf("%d",xyz);
        return 0;
    }

    A
    10

    B
    20

    C
    30

    D
    Compilation error

    E
    None of these

    Note: Two variables can have same name in different scope.
    1. Report
  7. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int xyz=20;
        int xyz;
        printf("%d",xyz);
        return 0;
    }

    A
    20

    B
    0

    C
    Garbage

    D
    Compilation error

    E
    None of these

    Note: Two local variables cannot have same name in same scope.
    1. Report
  8. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int xyz=20;{
             int xyz=40;
        }
        printf("%d",xyz);
        return 0;
    }

    A
    20

    B
    40

    C
    0

    D
    Compilation error

    E
    None of these

    Note: Two variables can have same name in different scope.
    1. Report
  9. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int main = 80;
        printf("%d",main);
        return 0;
    }

    A
    80

    B
    0

    C
    Garbage value

    D
    Compilation error

    E
    None of these

    Note: Variable name can be main.
    1. Report
  10. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        struct a{
             int a;
        };
        struct a b={10};
        printf(\"%d\",b.a);
        return 0;
    }

    A
    0

    B
    10

    C
    Garbage value

    D
    Compilation error

    E
    None of these

    Note: Two variables can have same name in different scope.
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd