Self Studies

Programming and...

TIME LEFT -
  • Question 1
    1 / -0

    Consider the following recursive function.

    Int function (int x, int y) {

                    If (y <= 0) return x;

                    return function (y, x%y);

                    }

    The above recursive function computes ______.

  • Question 2
    1 / -0

    Consider a 1-D array in which the index starts from 2 and ends at 153. The address of index 2 is 1100 and each data in the array takes 4 words. What is the address of A[125] where 125 is the index?

  • Question 3
    1 / -0

    Consider the below given code:

    #include <stdio.h>
    int main()
    {
    char c[] = "INDIA_CAPITAL_DELHI";
    char *p = c;
    printf("%s", p - p[2] - p[6] + p[7] + p[1]);
    return 0;
    }

    The number of characters in the output is _____.

  • Question 4
    1 / -0

    Consider the following belw mentioned C code:

    #include <stdio.h>
    int call( ) {
    static int x = 13;
    return x--;
    }
    int main( ) {
    int count = 1;
    for(call( ); call( ); call( ))
    count = count + call();
    printf("%d", count);
    return 0;
    }

    What is the output on the execution of the program?

  • Question 5
    1 / -0

    A is a 2D-array with the range [-5…..5, 3…..13] of elements. The starting location is 100. Each element occupies 2 memory cells. Calculate the location of A[0] [8] using column major order.

  • Question 6
    1 / -0

    Consider the following C functions.

    int f1 (int m) {

       static int j = 0;

       if (m > 0) {

          ++j;

          f1(m-1);

       }

       return (j) ;

    }

    int f2 (int m) {

       static int j = 0;

       if (m > 0) {

          j = j + f1(m) ;

          f2(m-1) ;

       }

       return (j) ;

    }

     

    The return value of f2(4) is ______

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 6

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
Submit Test
Selfstudy
Selfstudy
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