Array

Pos-Test

  1. What is the output of C Program.?
    int main()
    { int a[]; a[4] = {1,2,3,4};
    printf("%d", a[0]); }

  2. Compiler error
    2
    1
    4

  3. What is the output of C Program.?
    int main()
    { int a[] = {1,2,3,4};
    int b[4] = {5,6,7,8};
    printf("%d,%d", a[0], b[0]); }

  4. Compiler Error
    1,5
    0,0
    2,6

  5. What is the output of C Program.?
    int main()
    { char grade[] = {'A','B','C'};
    printf("GRADE=%c, ", *grade);
    printf("GRADE=%d", grade); }

  6. GRADE=some address of array, GRADE=A
    GRADE=A, GRADE=some address of array
    GRADE=A, GRADE=A
    Compiler error

  7. What is the output of C program.?
    int main()
    { char grade[] = {'A','B','C'};
    printf("GRADE=%d, ", *grade);
    printf("GRADE=%d", grade[0]); }

  8. 65 65
    A A
    65 A
    None Of The Above

  9. What is the output of C program.? int main() { int a[3] = {10,12,14}; int i=0; while(i<3) { printf("%d ", i[a]); i++; } }

  10. 10 10 10
    10 12 14
    14 12 10
    None Of The Above