Home / General Knowledge / Testing sawaal :: Discussion

Discussion :: Testing sawaal

  1. What will output when you compile and run the following code?

    #include <stdio.h>
    struct student
    {

    int roll;
    int cgpa;
    int sgpa[8];

    };

    void main()
    {

    struct student s = { 12,8,7,2,5,9 };
    int *ptr;
    ptr = (int *)&s;
    clrscr();
    printf( "%d", *(ptr+3) );
    getch();

    }

  2. A.
    8
    B.
    7
    C.
    2
    D.
    Compiler error

    View Answer

    Workspace

    Answer : Option C

    Explanation :



Be The First To Comment