Consider the following C function.void convert(int n){
if(n<0)
printf(“%d”,n);
else {
convert(n/2);
printf(“%d”,n%2);
}
Which one of the following will happen when the function convert is called with any positive integer n as argument?
Consider the following C program:
#include
int r(){
static int num=7;
return num--;
int main(){
for (r();r();r())
printf(“%d”,r());
return 0;
Which one of the following values will be displayed on execution of the programs?
N and P belongs to same subnet.
Hence, C is correct answer.
Consider three 4-variable functions f1, f2, and f3, which are expressed in sum-of-minterms as
f1 = Σ(0, 2, 5, 8, 14), f2 = Σ(2, 3, 6, 8, 14, 15), f3 = Σ (2, 7, 11, 14)
For the following circuit with one AND gate and one XOR gate, the output function f can be expressed as:
Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation schema X = (PQRS). X is not in BCNF. Suppose X is decomposed into two schemas Y and Z, where Y = (PR) and Z = (QRS).
Consider the two statements given below.
I. Both Y and Z are in BCNF
II. Decomposition of X into Y and Z is dependency preserving and lossless
Which of the above statements is/are correct?
Consider the following sets:
S1 Set of all recursively enumerable languages over the alphabet {0,1}
S2 Set of all syntactically valid C programs
S3 Set of all languages over the alphabet {0,1}
S4 Set of all non-regular languages over the alphabet {0,1}
Which of the above sets are uncountable?
S1: The set LRE is known to be countably infinite since it corresponds with set of turing machines.
S2: Since syntactically valid C programs surely run on Turing machines, this set is also a subset of set of Turing machines, which is countable.
S3: Set of all languages = 2Σ which is known to be uncountable. Σ* countably infinite
⇒ 2Σ is uncountable.
S4: Set of all non-regular languages includes set LNOT RE which is uncountable infinite and hence is uncountable.
So, S3 and S4 are uncountable.
Hence, B is the correct answer.
Consider the first order predicate formula ':
∀' [(∀' '|'⇒(('=')∨('=1)))⇒∃' ('>')∧(∀' '|'⇒(('=')∨('=1)))]
Here ‘a|b’ denotes that ‘a divides b’, where a and b are integers. Consider the following sets:
S1 {1,2,3,…,100}
S2 Set of all positive integers
S3 Set of all integers
Which of the above sets satisfy '?
∀x[∀z⊗x ⇒ ((z = x) ∨ (z = 1)) ⇒ ∃w (w > x) ∧ (∀z z⊗w ⇒ ((w = z) ∨ (z = 1)))]
The predicate ϕ simply says that if z is a prime number in the set then there exists another prime number is the set which is larger.
Clearly ϕ is true in S2 and S3 since in set of all integers as well as all positive integers, there is a prime number greater than any given prime number.
However, in S1 : {1, 2, 3, .....100} ϕ is false since for prime number 97 ∈ S1 there exists no prime number in the set which is greater.
So correct answer is C.
Let G be any connected, weighted, undirected graph.
I. G has a unique minimum spanning tree, if no two edges of G have the same weight.
II. G has a unique minimum spanning tree, if, for every cut of G, there is a unique minimum-weight edge crossing the cut.
Which of the above two statements is/are TRUE?