1. Question: Consider on following declaration in c: (i)short const register i=10; (ii)static volatile const int i=10; (iii)unsigned auto long register i=10; (iv)signed extern float i=10.0; Choose the correct one:

    A
    Only (iv)is correct

    B
    Only (ii) and (iv) is correct

    C
    Only (i) and (ii) is correct

    D
    Only (iii) correct

    E
    All are correct declaration

    Note: Option (III) is in correct due to we cannot specify two storage class auto and register in the declaration of any variable. Option (iv) is in correct due to we cannot use signed or unsigned modifiers with float data type. In c float data type by default signed and it cannot be unsigned.
    1. Report
  2. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
    long int 1a=5l;
    printf("%ld",1a);
        return 0;
    }

    A
    5

    B
    51

    C
    6

    D
    Compilation error

    E
    None of these

    Note: Invalid variable name. Variable name must star from either alphabet or underscore.
    1. Report
  3. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int _=5;
        int __=10;
        int ___;
        ___=_+__;
        printf("%i",___);
        return 0;
    }

    A
    5

    B
    10

    C
    15

    D
    Compilation error

    E
    None of these

    Note: Variable name can have only underscore.
    1. Report
  4. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int max-val=100;
        int min-val=10;
        int avg-val;
        avg-val = max-val + min-val / 2;
        printf("%d",avg-val);
        return 0;
    }

    A
    55

    B
    105

    C
    60

    D
    Compilation error

    E
    None of these

    Note: We cannot use special character – in the variable name.
    1. Report
  5. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int class=150;
        int public=25;
        int private=30;
        class = class >> private - public;
        printf("%d",class);
        return 0;
    }

    A
    1

    B
    2

    C
    4

    D
    Compilation error

    E
    None of these

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

    A
    10

    B
    40

    C
    50

    D
    Compilation error

    E
    None of these

    Note: Only first 32 characters are significant in variable name. So compiler will show error: Multiple declaration of identifier abcdefghijklmnopqrstuvwxyz123456.
    1. Report
  7. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        register xyz_123=91;
        auto pqr_123=991;
        const _1a1_=pqr_123+~xyz_123;
        printf("%d",_1a1_);
        return 0;
    }

    A
    900

    B
    999

    C
    899

    D
    Compilation error

    E
    None of these

    Note: Variable name can have digits.
    1. Report
  8. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        int class=150;
        int public=25;
        int private=30;
        class = class >> private - public;
        printf("%d",class);
        return 0;
    }

    A
    1

    B
    2

    C
    4

    D
    Compilation error

    E
    None of these

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

    A
    10

    B
    40

    C
    50

    D
    Compilation error

    E
    None of these

    Note: Only first 32 characters are significant in variable name. So compiler will show error: Multiple declaration of identifier abcdefghijklmnopqrstuvwxyz123456.
    1. Report
  10. Question: What will be output of the following c program?
    #include<stdio.h>
    int main(){
        register xyz_123=91;
        auto pqr_123=991;
        const _1a1_=pqr_123+~xyz_123;
        printf("%d",_1a1_);
        return 0;
    }

    A
    900

    B
    999

    C
    899

    D
    Compilation error

    E
    None of these

    Note: Variable name can have digits.
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd