• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

SP Contest 2

Question 1

In an experiment, one red dice and one black dice(both are fair) are rolled. What is the probability that,

  1. The number on black dice will divide the number on red dice.
  2. Number on black dice is multiple of the number on red dice.
  • 22 / 36 and 14 / 36 respectively

  • 12 / 36 and 18 / 36 respectively

  • 14 / 36 and 14 /36 respectively

  • 6 / 36 and 8 / 36 respectively

Question 2

What will be the remainder when 7100 is divided by 5?
  • 0
  • 1
  • 2
  • 3

Question 3

What will be the output of the below C program: C
int calc(int i)
{
    
	while(++i > 10); // statement 0
    
	i++;
    
	return i;
}

int main() {
    int i = 2;
    
    printf(\"%d\", calc(i));
    
    return 0;
}
Also, if we replace pre-increment operator by post-increment operator in statement 0, then what will be the output of the new program?
  • 11 and 12
  • 12 and 11
  • 4 and 5
  • 4 and 4

Question 4

Which of the following statement is used to copy data from one table and insert into another ?
  • SELECT AND INSERT INTO
  • INSERT INTO AND SELECT
  • SELECT FROM AND INSERT INTO
  • INSERT INTO SELECT

Question 5

Select the statements that are true about default and copy constructors in C++:
  1. Compiler doesn’t create a default constructor if the user writes any constructor except the copy constructor.
  2. Compiler creates a copy constructor if the user doesn\'t write its own copy constructor.
  3. Compiler doesn’t create a default constructor if the user writes any constructor even if it is copy constructor.
  • 1 and 2
  • Only 3
  • Only 2
  • 2 and 3

Question 6

Consider the following page reference string:
4, 3, 2, 1, 2, 1,  5, 6, 1,  2,  7, 6, 3, 1, 4, 2
Which of the following options, gives the correct number of page faults related to LRU page replacement algorithms with 04 page frame and if there is an increment in page frame i.e. 05 page frame then what will be the correct number of page faults, assuming all frames are initially empty?
  • 10 and 10
  • 11 and 10
  • 10 and 11
  • 11 and 11

Question 7

What is the probability of getting a Saturday in a Week?

  • 1

  • 1/7

  • 1/2

  • 2/7

Question 8

A C++ class can contain a member of SELF type if the member is.
  1. Static
  2. Pointer
  3. Non-static
  • Only 3
  • Both 2 and 3
  • Both 1 and 2
  • Only 1

Question 9

What will be the output of the below C++ program?
C
#include<iostream>
using namespace std;

int main()
{
    int a[] = {10,20,30,40,50};
    
    cout<<(*(&a+1)-a);
    
    return 0;
}
  • 10
  • 0x7ffc7185f754
  • 50
  • 5

Question 10

How does DHCP server dynamically assigns IP address to requesting host?
  • Dynamically, IP address is leased to requesting host for finite lease duration by DHCP server.
  • Dynamically IP address is leased to requesting host for an Infinite lease duration by DHCP server.
  • Dynamically, Static IP address is leased to requesting host for a finite lease duration by DHCP server.
  • Statically, dynamic IP address is leased to requesting host for an Infinite lease duration by DHCP server.

There are 10 questions to complete.

Last Updated :
Take a part in the ongoing discussion