Self Studies

Programming and...

TIME LEFT -
  • Question 1
    1 / -0

    What is the output of the below given code?

    #include <stdio.h>
    int main()
    {
    int j;
    j = printf("Testbook TestSeries\n");
    j = printf("%d\n",j);
    printf("%d\n",j);
    }

  • Question 2
    1 / -0

    Match the following list:

    List – I

    (Storage class)

    List – II

    (Storage, initial – value, scope)

    (a) auto

    (i) register, garbage, local

    (b) register

    (ii) memory, zero, global

    (c) static

    (iii)  memory, garbage, local

    (d) extern

    (iv) memory, zero, local

  • Question 3
    1 / -0

    What is the output of the below given code?

    #include <stdio.h>
    int main()
    {
    int a = 2;
    int year = 2020;
    char flag = 'a' + a;
    switch(flag)
    {
    case 'a': printf("GATE CS %d ",year);           
    case 'b':
    case 'c': printf("GATE CS %d ",year + 1);
    case 'd': break;
    default: printf("GATE CS %d",year + 2);
    }
    return 0;

    }

  • Question 4
    1 / -0

    Consider the below given code in which integer is of 2 bytes?

    #include <stdio.h>
    void function(int *co, int *vid)
    {
    co = vid;
    *co = 19;
    }
    int main()
    {
     int p = 20, q = 19;
    function(&q,&p);
    printf("Co-vid %d%d", p, q);
    return 0;
    }

    The output is Co-vid ____? (Fill in the blanks)

  • Question 5
    1 / -0

    Which one of the following choices given below would be printed when the following program is executed?

    #include<stdio.h>

    void display(int *tb[]);

    int main()

    {

    int array1[] = {2,5,8,12,6,9};

    int array2[] = {-12, 4, 6, -13,7};

    int array3[] = {-8, -6, -7, 9};

    int array4[] = {21, 23, 27,15,0};

    int *t[] = { array1, array2, array3, array4};

    display(t);

    }

    void display(int *tb[])

    {

    printf("%d and ", *(tb[2]+1));

    printf("%d", tb[3][1]);

    }

  • Question 6
    1 / -0

    If ‘a’ is declared as one-dimensional array in ‘C’ then

    a) *(a + i) is same as *(&a[i])

    b) *(a + i) is same as *a + i

    c) &a[i] is same as a + i - 1

    d) *(a + i) is same as a[i]

    Which of the above statements are incorrect?

  • Question 7
    1 / -0

    What is the output of the below given C program?

    #include <stdio.h>
    int main()
    {
    int loops = 0;
    int _shift = 7916; 
    while(_shift)
    {
    loops++;
    _shift >>= 2;
    }
    printf("%d",loops);
    }

  • Question 8
    1 / -0

    Consider the C program given belwo

    #include <stdio.h>
    struct charNode
    {
    char a, b, c, d; 
    };
    int main()
    {
    struct charNode ch = {'o'+3,'e'+10,'j'+15,'t'+1};
    struct charNode *ptr = &ch;
    printf("%c, %c",*(char *)ptr + 1,*((char *)ptr + 2));
    }

    What is the output?

  • Question 9
    1 / -0

    Consider the following definition of array in C:

    int a [ ] [2] [3]=

          {

             {

                {1, 2, 3},

                {4, 5, 6}

             },

             {

               {10, 20, 30},

               {40, 50, 60}

            },

            {

               {100, 200, 300},

               {400, 500, 600}

       }

    };

    Which of the following expressions would give value 1 for the array defined above?

    (a) a[0] [0] [0]

    (b) * * * a

    (c) * * * a[0]

    (d) * * a[0] [0]

    The correct answer is :

  • Question 10
    1 / -0

    Consider the below given code.

    #include<stdio.h>

    int main()

    {

    static int x[ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

    int i;

    for(int i = 2; i < 7; i++)

    x[x[i]] = x[i];

    int sum = 0;

    for(int j = 0; j < 10;j++)

    sum = sum + x[j];

    printf("%d",sum);

    }

    The value printed of sum is ____.

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 10

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
Submit Test
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now