Sunday 31 May 2015

Q35,paper 3,J 13 Which of the following is/are the fundamental semantic model(s) of parameter passing ?



(A) in mode
(B) out mode
(C) in-out mode
(D) all of the above
Answer D.

Explanation.

void write(int f)
{
//
}
void main()
{
int a = 3;
write (a);
}
We call a  as actual parameter and f as formal parameter.
Fundamental semantics model of parameter passing.
in -mode: Formal Parameters can receive data from Actual Parameter
• out-mode: Formal Parameter can transmit data to Actual Parameter
• inout-mode: Do both.
Conceptual Model of Data Transfer
• Transmission of actual value (copy)
• Transmission of access path (alias)




Q34,paper3,J 13.Horn clauses are special kinds of propositions which can be described as



(A) Single atomic proposition on left side.
(B) Single or multiple atomic proposition on left side.
(C) A single atomic proposition on left side and a single atomic proposition on right side.
(D) A single atomic proposition on left side or an empty left side.
Answer D.
explanation.
A literal is an atomic formula or its negation.
A clause is a disjunction of literals
A Horn clause is a clause with exactly one positive literal
A Horn formula is a conjunctive normal form formula whose clauses are all Horn 
Example.
VX ( human(X) → mortal(X) ).
VX(~human(x) v mortal(x)).

Q33,paper 3,J 13.Refer the points as listed below :



(a) What are the operator precedence rules ?
(b) What are the operator associativity rules ?
(c) What is the order of operand evaluation ?
(d) Are there restrictions on operand evaluation side effects ?

Which of the above must be considered as primary design issues
for arithmetic expressions ?
(A) (a), (b) and (c)
(B) (a), (c) and (d)
(C) (a), (b) and (d)
(D) (a), (b), (c) and (d)
Answer D.

Q32,Paper 3,J 13 Arrays in C language can have _________ with reference to memory representation.



(A) n-subscripts
(B) two-subscripts
(C) only one subscript
(D) three subscripts only
Answer c.
Elements of multidimensional arrays also can be specified using only one subscript, let the matrix .
     A0,0      A0,1
     A10      A1,1
     A2,1      A2,2
it can be referenced as
A0,0      can be represented by A[0].
A01 can be represented by A[1].
A10 can be represented by A[2].
Similarly
A22 can be represented by a[5]



Q31,paper 3,J 13. Images tend to be very large collection of data. The size of memory required for a 1024 by 1024 image in which the colour of each pixel is represented by a n-bit number, (in an 8 bit machines) is



(A) n ×8 MB

(B) n / 8 MB

(C) (1024 ×1024) / 8 MB

(D) 1024 MB



Answer B.

Explanation.

1MB=1024*1024.

------

Size of image.1024*1024 pixels.

1 pixel takes n bits

1024*1024 pixels takes 1024*1024*n bits.

-----

8 bits make I unit of memory.

1 bit make 1/8 unit of memory.

n MB need  n MB/8 unit of memory.