Self Studies

Programming and...

TIME LEFT -
  • Question 1
    2 / -0.33

    How do you instantiate an array in Java?

  • Question 2
    2 / -0.33

    What is the output of the following Java code?
    public class array
    {
        public static void main(String args[])
        {
            int []arr = {1,2,3,4,5};
            System.out.println(arr[2]);
            System.out.println(arr[4]);
        }
    }

  • Question 3
    2 / -0.33

    When does the ArrayIndexOutOfBoundsException occur?

  • Question 4
    2 / -0.33

    What is the number of  binary search trees possible with 9 distinct keys?

  • Question 5
    2 / -0.33

    What are the advantages of arrays?

  • Question 6
    2 / -0.33

    Assuming int is of 4bytes, what is the size of int arr[15];?

  • Question 7
    2 / -0.33

    A program X reads in 300 integers in the range [0..100] representing the %attendance of 300 students. It then prints the frequency of each %attendance above 25. What would be the best way for X to store the frequencies?

  • Question 8
    2 / -0.33

    Elements in an array are accessed _____________

  • Question 9
    2 / -0.33

    How do you initialize an array in C?

  • Question 10
    2 / -0.33

    If a queue is implemented using two stacks. In enqueue operation, all the elements are pushed from the first stack to the second stack. In dequeue operation pop an element from 1st stack.

    Which of the following is/are true?

  • Question 11
    2 / -0.33

    A function f defined on stack of integer satisfies the following properties f(empty) = 0 and f (push (S, i)) = max (f(s), 0) + i for all stacks S and integer i.

    After pushing integers 2, -3, 2, -1, 2 in order from bottom to top. f(s) returns the top of the stack. What is f(s)?

  • Question 12
    2 / -0.33

    What is the return output of the following C program segment?

    char c= '2';

     switch(c)

    {

    case '1': printf("C program, ");           

    case '2':

    case '3': printf("Java program, ");

    case '4' :

    case '5': break;

    default: printf("No program");

    }

    return 0;

    }

  • Question 13
    2 / -0.33

    Which of the following is the correct way to declare a multidimensional array in Java?

  • Question 14
    2 / -0.33

    Which of the following is/are true with respect to stacks and queues where where front points to the index where deletion is done and the rear points to the index where insertion is done in queue?

  • Question 15
    2 / -0.33

    What is the output of the following Java code?

    public class array
    {
        public static void main(String args[])
        {
            int []arr = {1,2,3,4,5};
            System.out.println(arr[5]);
        }
    }

  • Question 16
    2 / -0.33

    Which of the following is not a logical operator?

  • Question 17
    2 / -0.33

    Which of the following is true about return type of functions in C?

  • Question 18
    2 / -0.33

    Consider the following C declaration

    struct { 
        short s[5];
        union { 
             float y; 
             long z; 
        }u; 
    } t;

    Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment considerations, is

  • Question 19
    2 / -0.33

    #include <stdio.h>
    int main()
    {
        int i = 3;
        printf("%d", (++i)++);
        return 0;
    }

    What is the output of the above program?

  • Question 20
    2 / -0.33

    Consider the following C program

    main ( )

    {

    int N, x;

    scanf (“% d”, &N);

    x = 0;

    while (N > 0)

    {

    x = x + 1 – N % 2;

    N / = 2;

    }

    printf(“% d”, x)

    }

    What is the sum of the smallest three values of N for which the value printed is 5?

  • Question 21
    2 / -0.33

    Find the Output ?

    #include<stdio.h>

    int main() 

      int x, y = 5, z = 5; 

      x = y == z; 

      printf("%d", x); 

      getchar(); 

      return 0; 

    }

  • Question 22
    2 / -0.33

    Which file is generated after pre-processing of a C program?

  • Question 23
    2 / -0.33

    Which of the following is not a storage class specifier in C?

  • Question 24
    2 / -0.33

    The following postfix expression with single digit operands in evaluated using a stack

    4 2 5 ^ * 14 7 / - 7 5 * +

    Note that ^ is exponentiation operator, * is multiplication operator, / is division operator, + is addition operator and – is subtraction operator

  • Question 25
    2 / -0.33

    In C, parameters are always

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 25

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
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