August 26, 2019

Discrete Structures for Computer Science - MCQS

Note: We have tried to upload as much as we can, all the question and answers might be shuffled - Please find the answer below each question, some answers might be wrong please review on the last date(some answers might be changed) if you find any wrong answer please comment down below.

Question 1:
Let R be relation defined as R ={ <x,y>/ x - y is divisible  by m,a positive integer}
Which of the following is true?
Select one:
a. R is only reflexive
b. R is neither reflexive nor symmetric
c. R is reflexive and symmetric
d. R is R is reflexive, symmetric and transitive
Correct Answer: D

Question 2:
Consider the recurrence relation : a(n) =2 a(n-1) + a(n- 3)
Then the order of the characteristic polynomial of this recurrence relation is
Select one:
a. We can not determine
b. 2
c. 1
d. 3
Correct Answer: D

Question 3:
A relation R: S to  S is called a  partial order relation  if it is
Select one:
a. Reflexive, Antisymmetric, Transitive 
b. Irreflexive,Transitive, Antisymmetric
c. Reflexive,Transitive,Symmetric
d. only Reflexive, Transitive
Correct Answer: A

Question 4:
Consider the following diagram. And choose the correct option from the given



Select one:
a. This is not a lattice       
b. represents a improper lattice  
c. Represent a proper lattice
d. Does not represent a poset 
Correct Answer: C

Question 5:
How many ways are there to distribute six indistinguishable balls into nine distinguishable bins?
Select one:
a. 3003
b. 3000
c. 3030
d. 3300
Correct Answer: A

Question 6:
Let F be the function such that F(n) is the sum of the first n positive integers. Give a recursive definition of F(n).
Select one:
a. f(0) = 1, f(n) = f(n − 1) - n for n ≥ 1
b. f(0) = 0, f(n) = f(n − 1) + n for n ≥ 1
c. f(0) = 0, f(n) = f(n + 1) + n for n ≥ 1
d. f(0) = 1, f(n) = f(n + 1) - n for n ≥ 1
Correct Answer: B

Question 7:
Which of the following represents the Hasse diagram of the the relation  ({1,2,3},less than or equal to ) 
Select one:
a.






b.








c. 







Correct Answer: C

Question 8:
What is the generating function for the finite sequence 2, 2, 2, 2, 2, 2
Select one:
a. f (x) = 2(x2−1)/(x6−1)
b. f (x) = 2(x2−1)/(x−1)
c. f (x) = 2(x2−1)/(x2−1)
d. f (x) = 2(x6−1)/(x−1)
Correct Answer: D

Question 9:
Which of the following is true?
Select one:
a. Composition of functions is  NOT associative
b. Composition of functions is NOT commutative
c. Composition of functions is  Associative
d. Composition of functions is commutative
Correct Answer: D

Question 10:
Which of the following is True?
Select one:
a. Then recurrence relation a(n) = a(n-1) + a(n-2) is neither linear nor homogeneous
b. Then recurrence relation a(n) = a(n-1) + a(n-2) is always linear and non homogeneous
c. Then recurrence relation a(n) = a(n-1) + a(n-2) is always  non linear and homogeneous
d. Then recurrence relation a(n) = a(n-1) + a(n-2) is always linear and homogeneous
Correct Answer: D


Linear Algebra and Optimization- MCQS

Note: We have tried to upload as much as we can, all the question and answers might be shuffled - Please find the answer below each question, some answers might be wrong please review on the last date(some answers might be changed) if you find any of the answer is wrong please comment down below. 


Question 1:
When using a graphical solution procedure, the region bounded by the set of constraints is called the
Select one:
A.feasible region
B.infeasible region
C.maximum profit region
D.none of the above
Correct Answer is : A

Question 2:
An LP problem has a bounded feasible region. If this problem has an equality constraint, then
Select one:
A.this must be a minimization problem
B.the feasible region must consist of a line segment
C.the problem must be degenerate
D.the problem must have more than one optimal solution
Correct Answer is : B

Question 3:
If two constraints do not intersect in the positive quadrant of the graph, then
Select one:
A.The Problem is infeasible
B.The solution is unbounded
C.One of the constraints is redundant.
D.The solution is optimal
Correct Answer is : A

Question 4:
For a maximization problem, the coefficient for an artificial variable in the objective function while using two phase simplex method is
Select one:
A.+1
B.-1
C.+M
D.–M
Correct Answer is : B

Question 5:
When alternate optimal solutions exist in an LP problem, then
Select one:
A.the objective function will be parallel to one of the constraints
B.one of the constraints will be redundant
C.two constraints will be parallel
D.the problem will also be unbounded
Correct Answer is : A

Question 6:
A optimum solution to an LP problem
Select one:
A.Must satisfy all of the problem’s constraints simultaneously
B.Need not satisfy all of the constraints, only some of them
C.Must be corner point of the feasible region
D.Must optimize the value of the objective function
Correct Answer is :  D

Question 7:
If the constraint has ‘≥’ sign, then we introduce
Select one:
A.Surplus variable
B.Slack variable
C.artificial variable
D.Slack and surplus variables
Correct Answer is : A

Question 8:
If the feasible region gets larger due to a change in one of the constraints, the optimal value of the objective function
Select one:
A.must increase or remain the same for a maximization problem
B.must decrease or remain the same for a maximization problem
C.must increase or remain the same for a minimization problem
D.cannot change
Correct Answer is : A

Question 9:
If there is no feasible region in a LPP, then we say that the problem has
Select one:
A.Infinite solution
B.No solution
C.Unbounded solution
D.None of these
Correct Answer is : B

Question 10:
A graphical method should only be used to solve an LP problem when
Select one:
A.there are only two constraints
B.there are more than two constraints
C.there are only two variables
D.there are more than two variables
Correct Answer is : C

Question 11:
Which of the following is true with respect to the optimal solution of an LPP
Select one:
A.Every LPP has an optimal solution
B.Optimal solution of an LPP always occurs at an extreme point
C.At optimal solution all resources are used completely
D.If an optimal solution exists, there will always be at least one at a corner
Correct Answer is : D

Question 12:
If a linear program is unbounded, the problem probably has not been formulated correctly. Which of the following would most likely cause this?
Select one:
A.a constraint was inadvertently omitted
B.an unnecessary constraint was added to the problem
C.the objective function coefficients are too large
D.the objective function coefficients are too small
Correct Answer is : A

Question 13:
A linear program has been solved and sensitivity analysis has been performed. The ranges for the objective function coefficients have been found. For the profit on the upper bound is 80, the lower bound is 60, and the current value is 75. Which of the following must be true if the profit on this  variable is lowered to 70 and the optimal? Solution is found?
Select one:
A.a new corner point will become optimal
B.the maximum possible total profit may increase
C.the values for all the decision variables will remain the same
D.all of the above are possible
Correct Answer is : C

Question 14:
Maximize z = 3x + 4y subject to the constraints: 4x + 2y  80 , 2x + 5y  180 , x , y ≥ 0
Select one:
A.0 at (0, 0)
B.180 at (20, 30)
C.115 at (35, 2.5)
D.147.5 at (2.5, 35)
Correct Answer is : D

Question 15:
Which of the following would cause a change in the feasible region?
Select one:
A.increasing an objective function coefficient in a maximization problem
B.adding a redundant constraint
C.changing the right-hand side of a no redundant constraint
D.increasing an objective function coefficient in a minimization problem
Correct Answer is : C

Question 16:
A constraint that does not affect the feasible solution is a
Select one:
A.non-negative constraint
B.a redundant constraint
C.standard constraint
D.slack constraint
Correct Answer is : B

Question 17:
Which of the following is a valid objective function for  LPP?
Select one:
A.maximize 6xyz
B.maximize  3x +4y – z
C.minimize 5x2+7y3
D.none of these
Correct Answer is : B

Question 18:
In the optimal solution to a linear program, there are 20 units of slack for a constraint. From this we know that
Select one:
A.the dual price for this constraint is 20
B.the dual price for this constraint is 0
C.this constraint must be redundant
D.the problem must be a maximization problem
Correct Answer is : B

Question 19:
Lower and upper bounds in case of an unbounded variable is
Select one:
A.0 and ∞
B.– ∞ and 
C.0 and - ∞
D.none of these
Correct Answer is : A

Question 20:
Mathematical model of LP problem is important because
Select one:
A.It helps in converting the verbal description and numerical data into mathematical expression
B.Decision – makers prefer to work with formal models
C.It captures the relevant relationship among decision factors
D.It enables the use of algebraic techniques
Correct Answer is : A

Question 21:
From a set of equations x + 4y – z = 3 and 5x + 2y + 3z = 4 the basic feasible solution involving x, y is
Select one:
A.(5/9, 11/18, 0)
B.(5/9, 0, 0)
C.(0, 11/18, 0)
D.none of these
Correct Answer is : A

Question 22:
If a negative value appears in the solution values column of the simplex table, then
Select one:
A.the solution is optimal
B.the solution is infeasible
C.the solution is unbounded
D.all of the above
Correct Answer is : C

Question 23:
In solving a linear program, no feasible solution exists. To resolve this problem we might
Select one:
A.add another variable
B.add another constraint
C.remove or relax a constraint
D.try a different computer program
Correct Answer is : C

Question 24:
In LP, variables do not have to be integer valued and may take on any fractional value This assumption is called
Select one:
A.proportionality
B.divisibility
C.additivity
D.certainty
Correct Answer is : B

Question 25:
The role of artificial variable in the simplex method is
Select one:
A.To find optimal dual prices in the final simplex table
B.to start phases of simple method
C.to aid in finding an initial solution
D.convert inequality constraints into equality
Correct Answer is : C

Question 26:
Which of the following subroutines does a computer implementation in LPP by the simplex method use?
Select one:
A.Finding a root of a polynomial
B.Finding the determinant of a matrix
C.Finding the Eigen value of a matrix
D.Solving a system of linear equations
Correct Answer is : D

Question 27:
A feasible solution to an LP problem
Select one:
A.must satisfy all of the problem’s constraints simultaneously.
B.need not satisfy all of the constraints, only some of them
C.must be a corner point of the feasible region
D.must give the maximum possible profit
Correct Answer is : A

Question 28:
Let S1- The slack and surplus variables can be unrestricted in sign
S2 – A basic feasible solution cannot have zero value for any of the variables
Select one:
A.S1 – True, S2 – True
B.S1 – False, S2 - True
C.S1 – True, S2 – False
D.S1 – False, S2 – False
Correct Answer is : D

Question 29:
If dual has an unbounded solution, primal has
Select one:
A.Unbounded solution
B.Feasible solution
C.Infeasible solution
D.Optimum solution
Correct Answer is : C

Question 30:
If a non redundant constraint is removed from an LP problem, then
Select one:
A.the feasible region will get larger
B.the feasible region will get smaller
C.the problem would become nonlinear
D.the problem would become infeasible
Correct Answer is : A


Digital Electronics and Microprocessors - MCQS



Note: We have tried to upload as much as we can, all the question and answers might be shuffled - Please find the answer below each question, some answers might be wrong please review on the last date(some answers might be changed) if you find any of the answer is wrong please comment down below. 

Question 1
DMA interface unit eliminates the need to use CPU registers to transfer data From
(A)  MAR to MBR (B) MBR to MAR (C) I/O units to memory (D) Memory to I/O units
Select one:
a. c
b. a
c. b
d. d
Correct Answer: D

Question 2
Out of the 4 operations listed below , which do you find not to be taking place during the execution cycle?
(A) ALU performs the arithmetic & logical operation.
(B) Effective address is calculated.
(C) Next instruction is fetched.
(D) Branch address is calculated & Branching conditions are checked.
Select one:
a. a
b. c
c. b
d. d
Correct Answer: D

Question 3
For an 8086 find the physical memory address of the data stored in following memory locations
DS: BX   = 1000h:1200h
A. 11200 H   B. 13000H   C.  2200H     D. 22000H
Select one:
a. c
b. d
c. a
d. b
Correct Answer: C

Question 4
How many (128 x 8) RAM chips are needed to provide a memory capacity of
2048 X 16 ?
(A)  8 (B) 16 (C) 24 (D) 32
Select one:
a. a
b. c
c. b
d. d
Correct Answer: D

Question 5
1.If In addition of two signed numbers, represented in 2' s complement, A is the carry in to the sign bit position and B is the carry out of the Sign bit position then what logic will show an overflow condition?
(A)  A. B = 0 (B) A = 0 (C) A xor B = 1 (D) A + B = 1
Select one:
a. d
b. b
c. c
d. a
Correct Answer: C

Question 6
1.How many flip-flops are required for a divide by 32 counter?
A.3 B. 4 C.32 D.5
Select one:
a. a
b. b
c. d
d. c
Correct Answer: C

Question 7
A JK flip-flop can be implemented using D flip-flop connected such that
(A)D=JQ’+K’Q (B) D=J'Q+KQ (C)D=JQ+K'Q' (D) D=JQ+KQ'
Select one:
a. c
b. b
c. d
d. a
Correct Answer: D

Question 8
What will be the ending addresses of a 64 K Byte memory segment as in 8086 if the segment register contains AB11H
A. DCBF0H  B. ABBA0H  C. BB10F H  D. AB110H
Select one:
a. c
b. b
c. a
d. d
Correct Answer: C

Question 9
How does the CMP B instruction affect the flags? chose the best option
A. Only sign flag affected   B. Only Carry flag affected   C. All flags affected   D. None of the flags affected
Select one:
a. d
b. b
c. c
d. a
Correct Answer: C

Question 10
For 8086 What will be the content of Accumulator and the carry flag after executing the instruction RAR if the accumulator and carry flag contained  10100111 & 0 respectively before executing the instruction
A.11010011 & 1         B. 01010011 & 0
C.01010011 & 1         D.  11010011 & 0
Select one:
a. d
b. c
c. b
d. a
Correct Answer: B

Question 11
What are the basic steps for the execution of an instruction?
A.Fetch, Decode, Execute         B. Decode, Fetch, Execute
C.Decode, Execute, Fetch         D. Execute Decode, Fetch,
Select one:
a. c
b. a
c. d
d. b
Correct Answer: B

Question 12
For 8086  What is the length of the instruction POP D
A.4 Byte        B. 3 Byte
C.1 Byte        D. 2 Byte
Select one:
a. a
b. d
c. b
d. c
Correct Answer: D

Question 13
What register is used for reading status of  Flag Registers?
A. Flag Register        B. Status Register
C. Control register     D. Buffer Register
Select one:
a. a
b. b
c. d
d. c
Correct Answer: B

Question 14
IMUL is
A.Signed  Multiplication         B. Unsigned  Multiplication
C.Multiplication                 D. Inverse Multiplication
Select one:
a. b
b. d
c. c
d. a
Correct Answer: D


Computer Programming - MCQS

Note: We have tried to upload as much as we can, all the question and answers might be shuffled - Please find the answer below each question, some answers might be wrong please review on the last date(some answers might be changed) if you find any wrong answer please comment down below.


Question 1
Which among the following is not an usage of structure?
Select one:
A. Changing the size of the cursor
B. Receiving a key from the keyboard
C. Placing the cursor at an appropriate position on screen
D. Drawing any graphics shape on the screen
E. None of the options
Correct Answer: E

Question 2
#include <stdio.h>
struct sample
{
                int a=0;
                char b='A';
                float c=10.5;
};
int main()
{
                struct sample s;
                printf("%d,%c,%f",s.a,s.b,s.c);
                return 0;
}
Select one:
A. No Error, No Output
B. 0, A, 10.5
C. Error
D. 0, A, 10.500000
Correct Answer: C

Question 3
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
    char str1[20] = "Hello", str2[20] = " Program";
    printf("%s\n", strcpy(str2, strcat(str1, str2)));
    return 0;
}
Select one:
A. ProgramHello
B. Program
C. Hello Program
D. Hello
Correct Answer: C

Question 4
What will be the output of the program?
#include<stdio.h>
int main()
{
    static char s[25] = "C-Programming-skills";
    int i=0;
    char ch;
    ch = s[++i];
    printf("%c", ch);
    ch = s[i++];
    printf("%c", ch);
    ch = i++[s];
    printf("%c", ch);
    ch = ++i[s];
    printf("%c", ch);
    return 0;
}
Select one:
A. --Ps
B. C--s
C. C-Pr
D. -Pro
Correct Answer: A

Question 5
Which among the following is true about srtcmpi()?
Select one:
A. Compares two strings
B. Compares two strings with regard to case
C. Compares first n characters of two strings
D. Compares two strings without regard to case
Correct Answer: D

Question 6
Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
Select one:
A. char p = *malloc(100);
B. char *p = (char *)(malloc*)(100);
C. char *p = (char) malloc(100);
D. char *p = (char*)malloc(100)
Correct Answer: D

Question 7
# include <stdio.h>
void print(int arr[])
{
   int n = sizeof(arr)/sizeof(arr[0]);
   int i;
   for (i = 0; i < n; i++)
   printf("%d ", arr[i]);
}
int main()
{
   int arr[] = {4,5,7,1,2,6,7,8};
   print(arr);
   return 0;
}
Select one:
A. 4,5,7,1,2,6,7,8
B. Compile error
C. Run time error
D. 4 5
Correct Answer: D

Question 8
#include<stdio.h>
int i;
int fun();
int main()
{
    while(i)
    {
        fun();
        main();
    }
    printf("Hello");
    return 0;
}
int fun()
{
    printf("Hi");
}
Select one:
A. Infinite loop
B. Hello
C. No output
D. Hi Hello
Correct Answer: B

Question 9
#include&lt;stdio.h&gt;
void fun(int*, int*);
int main()
{
int i=5, j=2;
fun(&amp;i, &amp;j);
printf(&quot;%d, %d&quot;, i, j);
return 0;
}
void fun(int *i, int *j)
{
*i = *i**i;
*j = *j**j;
}
Select one:
A. 2, 5
B. 25, 4
C. 5, 2
D. 10, 4
Correct Answer: B

Question 10
Find the odd man out in the following:
Select one:
A. N[i]
B. *N+i
C. *(i+N)
D. *(N+i)
Correct Answer: B

Question 11
What will be the output of the program?
#include<stdio.h>
    struct course
    {
        int courseno;
        char coursename[25];
    };
int main()
{
    struct course c[] = { {102, "Ruby"},
                          {103, "Scala"},
                          {104, "Python"}     };
    printf("%d ", c[1].courseno);
    return 0;
}
Select one:
A. 104
B. 102
C. 103
D. Error
Correct Answer: C

Question 12
int main()
{
    int i;
    int arr[5] = {1};
    for (i = 0; i < 5; i++)
    printf("%d ", arr[i]);
    return 0;
}
Select one:
A. 11111
B. error
C. 10000
D. 00000
Correct Answer: C

Question 13
How will you free the allocated memory ?
Select one:
A. delete(var-name);
B. free(var-name);
C. remove(var-name);
D. dalloc(var-name);
Correct Answer: B

Question 14
___________is a macro which returns a 0 if end of file is not reached.
Select one:
A. Feof()
B. Ferror()
C. Fscanf()
D. Fprintf()
Correct Answer: A

Question 15
Can we receive input from keyboard for the array of pointers to strings?
Select one:
A. Yes
B. Rarely
C. No
D. May be
Correct Answer: C

Question 16
Accessing array elements by pointers is _____________ faster than accessing them
by subscripts.
Select one:
A. Not
B. Always
C. Sometimes
D. Probably
Correct Answer: B

Question 17
Which among the following is the drawback of putch, putchar, fputchar()?
Select one:
A. Outputs only one character at a time
B. None of the above
C. Comes out of the screen
D. Outputs more than one character at a time
Correct Answer: A

Question 18
What will be the output of the program?
#include<stdio.h>
#include<string.h>
int main()
{
    char sentence[80];
    int i;
    printf("Enter a line of text\n");
    gets(sentence);
    for(i=strlen(sentence)-1; i >=0; i--)
    putchar(sentence[i]);
    return 0;
}
Select one:
A. The sentence will get printed in same order as it entered
B. The sentence will get printed in reverse order
C. Half of the sentence will get printed
D. None of above
Correct Answer: B

Question 19
#include <stdio.h>
int main()
{
    int arr[10];
    // Assume that base address of arr is 4000 and size of integer
    // is 32 bit
    arr++;
    printf("%u", arr);
    return 0;
}
Select one:
A. 4020
B. 4002
C. lvalue required
D. 4004
Correct Answer: C
.
Question 20
What is the output of the following program?
int main()
{
    int i;
    int arr[4] = {0};
    for (i = 0; i <= 4; i++)
    printf("%d ", arr[i]);
    return 0;
}
Select one:
A. crash
B. prints 0 four times 1
C. Error
D. The program may print 0 four times followed by garbage value, or may crash if address (arr+5) is invalid.
Correct Answer: D