A Digital Age Deserves A Digital Leader

Few PG Entrance test quest Objective Type(very important)

Few PG Entrance test quest Objective Type(very important)

Postby DEVILSAN » Sun May 30, 2004 10:16 am

Somebody Please help me answer these question with supporting explanation.

Here are few PG Entrance test questions Objective Type.

Q.1 if the code segment points at address x and the program counter has value y , then the next instruction will be fetched from

options are

(A) xy
(B)x+2y
(C)2x+y
(D)x+y

Answer with explanation:

Q.2 What is the output of the following recursive procedure when called as A(125,15) ?procedure A(x,y)
if y=0 then return (x)
Else return (A(y,x mod y))
endif
end A

options are
(A)10
(B)125
(C)5
(D)25

Answer with explanation:


Q.3 With an IP address of 201.141.20.10 which of the following is the default subnet mask?

options are
(A)0.0.0.0
(B)255.255.0.0
(C)255.255.255.0
(D)255.255.0.0

Answer with explanation:



You are welcomed :yesnod: :yesnod: :yesnod: :yesnod:
PRO Level 13
User avatar
Posts: 751
Joined: Sat Oct 18, 2003 6:17 pm
Location: Canada
Real Name: san luthra

Postby emolamol » Sun May 30, 2004 1:22 pm

hi devilsan,
i think i know the answer of 1st 2 question


1)answer is (d)i.e x+y

the reason is if y is the relative address of the next instruction in the program then after adding it with x(vich is the absolute address of the memory location where program starts.)..x+y becomes the absolute address the next instruction to be fetched.

2)answer is (c)i.e 5

this code is to find the GCD of two numbers.
and GCD(125,15)=5
Amol
Image
PRO Level 2
User avatar
Posts: 40
Joined: Mon May 17, 2004 9:31 am
Location: india->Mumbai

Postby DEVILSAN » Sun May 30, 2004 4:32 pm

Well Done Amol
PRO Level 13
User avatar
Posts: 751
Joined: Sat Oct 18, 2003 6:17 pm
Location: Canada
Real Name: san luthra

Postby Weaver » Sun May 30, 2004 5:35 pm

With your first question you should indicate which ISA you are referring to. Logic would say x86 due to its popularity and the segmented memory model, but it is always better to specify. Now on to question 3.

3) C

The leading octet of the IP is '201', which puts it as a Class C address (ignoring any CIDR).

0 - 127 = Class A
128 - 191 = Class B
192 - 223 = Class C

Since it is a Class C, the subnet mask would be 255.255.255.0 or 'C'

-Weaver
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

PG questions objective type

Postby DEVILSAN » Sun May 30, 2004 6:02 pm

even i thought the same way weaver
PRO Level 13
User avatar
Posts: 751
Joined: Sat Oct 18, 2003 6:17 pm
Location: Canada
Real Name: san luthra

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron
cron