Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

SBT|DAILY TEST|9 JUN

 TECHNICAL MCQ:

1. C

2. b

3. b

4. C

5.  a

6. c

7. c

8. a

9.  b

10. c


******************************************************

PROGRAMMING :


 1.

Problem Statement
Given a positive integer n. Recursively print the inverted triangular pattern as described in the sample
test cases below
Input Format
A single integer n.
Constraints
1<=n<=20
Output Format
Refer to sample test cases


PYTHON CODE:

def printPatternRowRecur(n):
 
    if (n < 1):
        return
         
   
    print("*", end = " ")
    printPatternRowRecur(n - 1)
 
def printPatternRecur(n):
 
    
    if (n < 1):
        return
     

    printPatternRowRecur(n)
     
   
    print("")
     
    printPatternRecur(n - 1)
     

n = int(input())
printPatternRecur(n)

2.

Problem Statement
Print the given pattern recursively. Refer to sample test cases for clarification.
Input Format
A single integer n.
Constraints
1<=n<=20
Output Format
As shown in the sample test cases.
 

 C CODE:

 #include <stdio.h>
int main() {
   int i, j, rows;
   scanf("%d", &rows);
   for (i = rows; i >= 1; --i) {
      for (j = 1; j <= i; ++j) {
         printf("*");
      }
      printf("\n");
   }
    for (i = 1; i <= rows; i++){
            for (j = 1; j <= i; j++){
                printf("*");
            }
      printf("\n");
     }
   return 0;
}


3.

Problem Statement
Katie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they
often share everything with each other and work together on some very hard problems.
Today is Shiro's birthday. She really loves pizza so she wants to invite her friends to the pizza restaurant
near her house to celebrate her birthday, including her best friends Katie and Kuro.
She has ordered a very big round pizza, in order to serve her many friends. Exactly n of Shiro's friends
are here. That's why she has to divide the pizza into n+1 slices (Shiro also needs to eat). She wants the
slices to be exactly the same size and shape. If not, some of her friends will get mad and go home early,
and the party will be over.
Shiro is now hungry. She wants to cut the pizza with minimum of straight cuts. A cut is a straight
segment, it might have ends inside or outside the pizza. But she is too lazy to pick up the calculator.
As usual, she will ask Katie and Kuro for help. But they haven't come yet. Could you help Shiro with this
problem?
Input Format
A single line contains one non-negative integer n — the number of Shiro's friends. The circular pizza has
to be sliced into n+1 pieces.
Constraints
(0≤n≤10^18)
Output Format
A single integer — the number of straight cuts Shiro needs.

 

PYTHON CODE :

n = int(input())

n+=(n>1)

print(n//(2-(n%2)))

 

************************************************************

Permutations and combinations

1.

There are 7 gentlemen and 5 ladies to dine at a round table. In how many ways can they seat
themselves so that no two ladies are together?
None of the mentioned options
5!
7!
6!7C55!


2.

In how many ways can the letters of the word 'TOGETHER' be arranged so that O and G are always
together?
7!
6!
5!
2520

 

3.

In how many ways can 24 plus (+) signs and 13 minus (-) signs be arranged in a row so that no two
25c23
25c13
15c13
none
 

 

4.

How many words can be formed by the letters of the word "LIGHT" when all consonants come together?
4!5!
7!8!
9!6!
2!4!
 

 

5.

Find the rank of the word PIGEON.
757
858
656
none
 

6.

Find the no. of ways in which 10 boys and 10 girls be seated in a row, so that all the girls are never
together.
20!
20! -(11!*10!)
11!
none

 

7.

If there are 75 persons in a party and if each two of them shake hands with each other, how many
handshakes happen in the party?
2775
3775
4755
None of the mentioned options

 

8.

How many words can be formed by the letters of the word "DEVIKA" when each word begins with I?
5!
4!
3!
none

 

9.

Find the no. of different 3 letter words, with or without meanings that can be formed from the letters of
the word "CHAIR"
60
72
84
96

 

10.

Find the no. of ways in which 13 boys and 16 girls be seated in a row, so that all the girls sit together and
all the boys sit together.
16!
13!
13!*16!
2!13!16!

 

11.

No. of ways in which 7 persons can be seated around a table so that 2 particular persons are never
seated together is equal to:
470
490
500
480
 

 

12.

If 16 persons, each of them are taking and giving gift to each other, how many gifts are required?
251
245
240
None of the mentioned options
 

 

13.

 How many words can be formed by the letters of the word "FRIEND" when each word begins with F and
ends with D?
8!
7!
4!
5!


14.

The no. of ways in which 8-different books can be distributed among 5-students is.
8^5
8!
5!
5^8

 

15.

Three men have 4-coats, 6 twist coats and 7 caps. In how many ways can they wear them?
604800
704800
804800
None of the mentioned options
 

 

16.

In how many ways can a party of 12 men and 12 women be seated at a circular table so that no two
women are adjacent.
12!13!
11!12!
11!13!
None of the mentioned options

 

17.

In how many ways can a garland of 100 flowers be made?
2!
99!
none
99!/2

 

18.

How many words can be formed by the letters of the word "SUBJECT" when there is no restriction on
letters?
4!
5!
7!
none

 

19.

There are 50 points in a plane, in which 17 are co-linear. How many straight lines are drawn from a pair of
points?
478!
25C13
25C13 -1
50C2- 17C2+1

 

20.

How many numbers can be formed with the digits 2,4,5,7,5,4,6,7, so that the even digits always occupy
the even places.
72
45
27
none
 

 

21.

How many words with or without meaning can be formed by using the letters of the word "PEN".
4!
5!
6!
3!
 


 

22.

In how many ways can 6 examination papers be arranged so that the best and the worst papers are
never together?
5!
4!
6!
4*5!

 

23.

In how many ways can the letters of the word BINDU be arranged. So that N and D are always together?
5!8!
9!7!
2!6!
4!2!
 

 

24.

How many of these begin with M and end with N in the word MISCELLANEOUS?
11!
10!
11!/(2!2!2!)
none
 

 

25.

Find the rank of the word RANDOM
615
614
715
none

 

26.

How many words can be formed by the letters of the word "LION" when all vowels come together?
4!8!
3!2!
7!9!
none

 

27.

How many different words can be formed with the letter of the word DIFFERENT
9!
25!
9!/(2!*2!)
none
 

 

28.

The number of ways of distributing 15 identical balls in 4 distinct boxes so that none of the boxes is
empty is
487
364
582
none
 

 

29.

Find the number of lines, triangles and diagonals in a decagon.
45,45,45
120,120,35
None of the mentioned options
45,120,35

 

30.

How many words can be formed from the letters of the word "BEGIN"? How many of these will begin with
B end with N?
5!
4!
7!
3!

 

***************************************************
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 



 




Post a Comment

Previous Post Next Post