Sie sind auf Seite 1von 127

Operating System

HCL
1.which of the following involves context switch,(HCL)
a) system call b)priviliged instruction
c)floating poitnt exception
d)all the above
e)none of the above
ans: a

2. Semafore is used for (HCL)


a) synchronization b0 dead-lock avoidence
c)box d) none
ans : a

3. OLE is used in (HCL)


a)inter connection in unix
b)interconnection in WINDOWS
c)interconnection in WINDOWS NT

5) In signed magnitude notation what is the minimum value that


can be represented with 8 bits
a) -128 b) -255 c) -127 d) 0

Honeywell
6)Why paging is used ?

7)Which is the best page replacement algo and Why ?

8)What is a Real-Time System ?

9)What is the difference between Hard and Soft real-time systems ?

10)What is a mission critical system ?

11)What is the important aspect of a real-time system ?

12)Explain the difference between microkernel and macro kernel.

13)Give an example of microkernel.

14) How the messages are processed in Windows ?


(Queue of events)

15) Digital signal processing

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


16) If there are too many page faults what is the problem?

17) To ensure one pgm. doesnt corrupt other pgm. in a Multi-pgm. enviornment
what you should do?

18) Which one you will use to implement critical section?


Binary Semaphore
HUGES:

19. A qn to find the physical address from a given virtual address, virtual
to physical address table was provided

20 Scheduling Preemptive

21) Virtual to physical address mapping


page table given

22) which one of following is not memory management model? given buddy system,
monitors, paging, swapping Ans. Monitors

23)One solution for deadlock prevention for dining philosopher's problem


Ans. Allow one person to take first left stick and then right stick and remaining
persons in reverse order.

24) given page table,page size and offset find the corresponding
physical address ?
ans : a (3*1024+576) (pageno*pagesize+offset)

25) In scduling algorithnms which are logically executed but suspended


a) preemptive
b) SJF
c)non preemptive
d) all the above
Ans : a

26 process states ? which is the correct order


a) timeout:ready -> running
b) blocked : ready -> running
c)
d)

27) for converting infix expression to postfix what


do we require
a) operand stack
b) operator stack
c)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


HUGHES
28) once context swithing occures then ------------will take place
a)saving register
b)saving stack
c)....
d).....

29) what is not necessary condition in dead lock

30) machestor code does not improves


A. clock recovery
b. bandwidth efficiency
c.
ANS: B

31) in demand paging overhead of context switching is more due to


a. copy processes from disk to memory
b. viceversa
c. to get associative table
d. swapping to the disk

32) what will be the result of the following program ?


char *gxxx()
{
static char xxx[1024];
return xxx;
}

main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
Ans) b

33) What will be result of the following program?


void myalloc(char *x, int n)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
Ans) c ( check it )

INTEGRA

34) Expand the following


a) ISDN
b) CASE
c) CSMA/CD
d) OOPS
e) MIMD

35) Which of the following can be zero? (only one)


a) swap space
b) physical memory
c) virtual memory

36) What is a must for multitasking?


a) Process preemption
b) Paging
c) Virtual memory
d) None of the above

37) Who handles page faults?


a) OS
b) MMU
c) Hardware logic
d) etc etc....

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


38) what is the essential requirement for an real-time systems
a) pre-emption
b) virtual memory
b) paging etc...
c)
39)On Deadlock : Trivial answer, Shared Data

40) CPU Utilization:


given CPU time : 20 %
paging : 97.7%
I/O : 5.33 %

Which of the following is not likely to improve CPU Utilization:


Ans: Installing a faster CPU

41) If you undelete a file in unix or dos can you recover it?
If you can how will you do it?

42) Which page replacement algo. is the best one? ie. the one which
will give less page faults, assuming cache memory is not there.

43) Do you know unix internals?


Ramco
44)ual memory size depends on
[a] address lines [b] data bus
[c] disc space [d] a & c [e] none

Ans : a
45) Critical section is
[a]
[b] statements which are accessing shared resourses
Ans : b

46) load a
mul a
store t1
load b
mul b
store t2
mul t2
add t1

then the content in accumulator is

Ans : a**2+b**4

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


BFL
47)process is (program in execution)

48)Thread is (detachable unit of executable code)

49)advantage of Win NT over Win 95 (robust &secure)

50)memory managemant in Win95 (paging &segmentation

51) multitask win95 (preemptive or non preemptive check

52) semaphore is (synchronization of multiple processes

53) unix system is


a)multi processing
b)multi processing ,multiuser
c)multi processing ,multiuser,multitasking
d)multiuser,multitasking

54)for an application which exceeds 64k the memory model should be


a)medium
b)huge
c)large
d)none

55)the condition required for dead lock in unix sustem is

56)set-user-id is related to (in unix)

57) bourne shell has


a)history record
b)
c)
d)

58)UIL(user interface language) (x-win)

59)which is right in ms-windows


a)application has single qvalue system has multiple qvalue
b) " multiple " " single "
c)" " " multiple "
d)none

60widget in x-windows is

61)adget in x_windows is

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


62)link between program and out side world (ms -win)
a)device driver and hardware disk
b)application and device driver
c)application and hardware device
d)none

63)s -windows is
a)multitasking
b) c) d)
dynimic scoping is

64)after logout the process still runs in the background by giving


the command
a)nohop
b)

65)rocess dies out but still waita


a)exit
b)wakeup
c)zombie
d)steep

66)in dynamic memory allocation we use


a)doubly linked list
b)circularly linked
c)B trees
d)L trees
e)none

67) Most of the Windows operating systems are....choices are given like
----a,maltitasking,multiuser,multi processing
b,only.......&......
c,only........&......
like that

68)Sticky bit concept

69)Bourne shell.,no hup concept

70) unix system is


a)multi processing
b)multi processing ,multiuser
c)multi processing ,multiuser,multitasking
d)multiuser,multitasking

71)a node has the ip address 138.50.10.7 and 138.50.10.9.But it is

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


transmitting data from node1 to node2only. The reason may be
a)a node cannot have more than one address
b)class A should have second octet different
c)classB " " " " "
d)a,b,c

72)for an application which exceeds 64k the memory model should be


a)medium
b)huge
c)large
d)none

73) Fastest IPC mechanism is


a)shared memory b)pipes c)named pipes d)semaphores
Ans:c

74) 1-way set associative memory is called-----


a)direct b)something c)1-way set associative 4)something
Ans: c

75) The fastest memory is


(i) DRAM, (ii) ROM, (iii) SRAM, (iv) Main memory
Ans : SRAM

76) Programing exceptions are


(i) Asynchronous, (ii) Synchronous, (iii) None
Ans : Asynchronous

77)DSP which architecture is used


(i) MIMD, (ii) SIMD, (iii) Nueman, (iv) Harvard Architecture
Ans : Harvard Architecture

78) 1.the feature of real time os is:


ANS:fast context swithing.
os impliments protection with the help of hardware(like virtual
addressing in 386/286 etc).

79) the LRU algorithem


a) pages out pages that have been used recently
b) pages out pages that have notbeen used recently
* c) pages out pages that have been least used recently
d) pages out the first page in given data

80)which of the following is responsible for coordinating various


operations using timing signals?
a.arithmetic-logic unit

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


*b. control unit
c. memory unit
d. input/output unit

81) Data encryption


a) is most used by public billboard networks
* b) " " " financial "
c) canot " private installation
d) is not necessary ..

82) An ideal compiler should


a) be a smaller in size
b) produce object code that is smaller in size and executes faster
c) take less time of compiling
d) all the above

83) File record length


*a)should always be fixed
b)should always be variable
c)depends upon the size of the file
d)should be choosen to match the data characteristics

84)NLP stands for


*a)natural language processing
b)neuro logic programming
c)normal logic pad
d)nominal loadable process
e)none

85) What is deadlock? How do you avoid it?

86)What is a semaphore?

87)What exactly happens after each system call in sockets, both at the
client and at the server.

88)What is the difference between widget & gadget in XWindows?

89) What is best data structure to store the processes info in a real time operating
system?

90) what is a real time system.

91)name some real time OS

92)what are the characteristics of Real time OS.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


93)is DOS a real time OS.

94)what is a kernel,shell.

95) Virtual memory size depends on


[a] address lines [b] data bus
[c] disc space [d] a & c [e] none

Ans : a

96) Critical section is


[a]
[b] statements which are accessing shared resourses
Ans : b
Windows
1)MS windows 3.1 is a
a)operating system
b)Application
c)Programing language
d)database
e)shell
(Ans will be b)

2).MS Windows 3.1 supports which tyoe of multi-tasking?


a)cycle
b)executive
c)preemptive
d)Non-preemptive
e)Manual
(Ans )

3) Which message is displayed when a window is destroyed


a)WM_CLOSE
b)WM_DESTROY
c)WM_NCDESTROY
d)WM_POSTDESTROY
E)NONE
(Ans is b)

4) Which message is displayed when a window is destroyed


a)WM_CLOSE
b)WM_DESTROY
c)WM_NCDESTROY
d)WM_POSTDESTROY
E)NONE

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(Ans is b)

5) Which of the following API is used to hide a window


a) ShowWindow
b) EnableWindow
c) MoveWindow
d) SetWindowPlacement
e)None of the above
Ans) a

6)which of the following function is used to repaint a window


immediately
a) Sendmessage(hWnd,WM_PAINt,......)
b) InvalidateRect(.......)
c) MoveWindow
d) WM_COPY
e) None

7) which function is the entry point for a DLL in MS Windows 3.1


a) main
b) Winmain
c) Dllmain
d) Libmain
e) None
Ans) b

8) MS windows 3.1 is a
a)operating system
b)Application
c)Programing language
d)database
e)shell
(Ans will be b)

9).MS Windows 3.1 supports which tyoe of multi-tasking?


a)cycle
b)executive
c)preemptive
d)Non-preemptive
e)Manual

10) Which message is displayed when a window is destroyed


a)WM_CLOSE
b)WM_DESTROY
c)WM_NCDESTROY
d)WM_POSTDESTROY

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


E)NONE
(Ans is b)

11)Send Message and postmessage are


a)send message puts the message in the message queue and results,
postmessage processes the message immediately
b)Sendmessage processes the message immediately,postmessage puts
the message in the queue and returns
c) Both put the message in the message queue and returns
d) Both process the message immediately
e) None of the above
(Ans will be b check)

12) Which of the following message is used to limit the size


of teh Window
a)WM_SIZE
b)WM_PAIN
c) WM_GETMINMAXINFO
d) WM_COMMAND
e) WM_CREATE
(Ans is a)

13)Which of the following is not a GDI object


a)HBRUSH
b)HPEN
c)HBITMAP
d)HRGN
e)HWND
(Ans ic e)

14) Which of the following message is used to initialize the


contents of a dialog
a)WM_CREATE
b)WM_SIZE
c)WM_COMMAND
d)WM_INITDIALOG
e)none
(Ans will be d)

15) Which of the following API is used to hide a window


a) ShowWindow
b) EnableWindow
c) MoveWindow
d) SetWindowPlacement
e)None of the above
Ans) a

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


16) which of the following function is used to repaint a window
immediately
a) Sendmessage(hWnd,WM_PAINt,......)
b) InvalidateRect(.......)
c) MoveWindow
d) WM_COPY
e) None

17) which function is the entry point for a DLL in MS Windows 3.1
a) main
b) Winmain
c) Dllmain
d) Libmain
e) None
Ans) b
18) .function to repaint a window immediately?.

19).Function entry for DLL in win3.1

20) win 3.1 is a

21))win 3.1 supports which type of multi tasking?.

22) .Message displayed when a window is destroyed

23)About fork()?

24).About send message and post message

25).Message to limit the size of window

26).System call executable binary file intoa process

27).About GDI object?.

28).API used to hide window

29) Initialize contents of a dialog?.

UNIX
1)The command ......ln/bin/mail /usr/you/bin/m
a)will not be executed because you are linking files

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


across different file systems
b)results ln /bin/main being the same file as /usr/you/bin/m
c)results in 2 links to the file mail
d) " " " " m
e)none
(Ans will be b)

2)In a standerd directory lay out ,/etc is the directory where


a) basic programs such as who and ed reside
b) device related files reside
c)various administrative files such as password file reside
d) short-lived files created during program execution reside
e) the C sub-routine library resides
(Ans is c)

3) The command echo *


a) echoes all files in the current directory
b) prints * on the screen
c) is an invalid command
d) is the same as the command echo\*
e) is the same as echo"*"
(Ans is a)

4)until who|grep mary


do
sleep 60
done
a) is syntactically incorrect
b) waits 60 seconds irrespective of Mary being logged in or not
c) waits until Marry is logged in
d)waits till Mary exited
e)None
(Ans is c)

5)The UNIX system call that transforms an executable binary file into
a process is
a)execl()
b)execv()
c)execle()
d)execve()
e)All of the above
(Ans will be e check)

6)Which of the following is true about fork()


a) it transforms an executable binary file into a process that
overlays the process which made the fork() system call.NO new process is

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


created.
b) Causes the creation of a new process, the CHILD process, with a new
process ID
c)Causes the creation of a new process, the CHILD process ,with the
same process ID as the parent
d)fork() has nothing to do with processes
e)fork() is not a system call
(Ans is b)

7) What do the following variable names represents?


sort register
volatile default
a) short - is not a reserved keyword
b ) volatile & register - is not a reserved keyword
c)all the above are keywords
d) all are valid variable names
e) default - is not a reserved keyword
(Ans is c)

IBM
8)Which of the following message is used to initialize the
contents of a dialog
a)WM_CREATE
b)WM_SIZE
c)WM_COMMAND
d)WM_INITDIALOG
e)none
(Ans will be d)

9)Interprocess communication in UNIX can be achieved using


a)pipe
b)Message
c)Semaphores
d)Shared Memory
e)All of the above
(Ans is e)

10) Which of the following is true


a)UNIX is a time sharing multi-user OS
b)UNIX has a device independent file system
c)UNIX is full duplex
d)UNIX has command interpreter
e)All of the above
(Ans is e)
11)In UNIX a files i-node
a)is a data structure that defines all specifications

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


of a file like the file size ,number of lines to a
file ,permissions etc.
b).----
c). - - - --
d). _ _ _
( ans is ---------(a) )

12). The UNIX shell is....


a).does not come with the rest of the system
b).forms the interface between the user and the kernal
c) does not give any scope for programming
d) deos not allow calling one program from with in another
e) all of the above
(ans is (b) )

13) The very first process created by the kernal that runs
till the kernal process is haltes is
a)init
b)getty
c)
d)
e)none
(Ans is a)

14)In the process table entry for the kernel process, the process id value
is
a) 0 b) 1 c) 2 d) 255 e) it does not have a process table entry
Ans) a

15) PATH = /bin : /usr : /yourhome


The file /bin/calender has the following line in it
cal 10 1997
The file /yourhome/calender has the following line in it
cal 5 1997
If the current directory is /yourhome and calender is executed
a) The calendar for May 1997 will be printed on screen
b) The calendar for Oct 1997 will be printed on screen
c) The calendar for the current month( whatever it is) will be printed
d) Nothing will get printed on screen
e) An error massage will be printed

16) The standard source for standard input , standard output and standard
error is
a) the terminal
b) /dev/null
c) /usr/you/input, /usr/you/output/, /usr/you/error respectively

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


d) NOne
Ans) a

17) The redirection operators > and >>


a) do the same function
b) differ : > overwrites, while >> appends
c) differ : > is used for input while >> is used for output
d) differ : > write to any file while >> write only to standard output
e) None of these
Ans) b

18) The command


grep first second third /usr/you/myfile
a) prints lines containing the words first, second or third from the
file /usr/you/myfile
b) searches for lines containing the pattern first in the files second,
third, and /usr/you/myfile and prints them
c) searches the files /usr/you/myfiel and third for lines containing the
words first or second and prints them
d) replaces the word first with the word second in the files third and
/usr/you/myfile
e) None of the above
Ans) b

19) After the following command is executed


$ ln old new
a listing is performed with the following output
$ ls -li

total 3
15768 -rw-rw-rw- 2 you 29 Sep 27 12:07 old
15768 " " " " " " " " new
15274 " " 1 " 40 " " 09:34 veryold
which of the following is true
a)old and new have same i-node number,2
b) " " " " " " " , 15768
c)old and new have nothing yo do with each other
d)very old and new are linked
e)very old and old are linked
(Ans is b)

20)The command ......ln/bin/mail /usr/you/bin/m


a)will not be executed because you are linking files
across different file systems
b)results ln /bin/main being the same file as /usr/you/bin/m
c)results in 2 links to the file mail

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


d) " " " " m
e)none
(Ans will be b)

21)In a standerd directory lay out ,/etc is the directory where


a) basic programs such as who and ed reside
b) device related files reside
c)various administrative files such as password file reside
d) short-lived files created during program execution reside
e) the C sub-routine library resides
(Ans is c)

22) The command echo *


a) echoes all files in the current directory
b) prints * on the screen
c) is an invalid command
d) is the same as the command echo\*
e) is the same as echo"*"
(Ans is a)

23)until who|grep mary


do
sleep 60
done
a) is syntactically incorrect
b) waits 60 seconds irrespective of Mary being logged in or not
c) waits until Marry is logged in
d)waits till Mary exited
e)None
(Ans is c)

24)The UNIX system call that transforms an executable binary file into
a process is
a)execl()
b)execv()
c)execle()
d)execve()
e)All of the above
(Ans will be e check)

25)Which of the following is true about fork()


a) it transforms an executable binary file into a process that
overlays the process which made the fork() system call.NO new process is
created.
b) Causes the creation of a new process, the CHILD process, with a new process
ID

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c)Causes the creation of a new process, the CHILD process ,with
the same process ID as the parent
d)fork() has nothing to do with processes
e)fork() is not a system call
(Ans is b)

26)Interprocess communication in UNIX can be achieved using


a)pipe
b)Message
c)Semaphores
d)Shared Memory
e)All of the above
( Ans is e)

27) Which of the following is true


a)UNIX is a time sharing multi-user OS
b)UNIX has a device independent file system
c)UNIX is full duplex
d)UNIX has command interpreter
e)All of the above
(Ans is e)

28). PS1 pwd


export PS1 results in
a). your primary prompt being your current directory
b). " " and secondary prompts being the current dir
c). " " prompt being your home dir
d). " " and secondary prompts being the home dir
e). None of the above.

29). If you type in the command


nohup sort employees > list 2 > error out &
and log off ,the next time you log in . the output
will be
a). in a file called list and the error will de typed in
a file error out
b). there will be no file called list or error out
c). error will be logged in a file called list and o/p
will be in error out
d). you will not be allowed to log in
e). none of the above

30). In UNIX a files i-node


a)is a data structure that defines all specifications
of a file like the file size ,number of lines to a
file ,permissions etc.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b).----
c). - - - --
d). _ _ _
( ans is ---------(a) )

31). The UNIX shell is....


a).does not come with the rest of the system
b).forms the interface between the user and the kernal
c) does not give any scope for programming
d) deos not allow calling one program from with in another
e) all of the above
(ans is (b) )

32) The very first process created by the kernal that runs
till the kernal process is haltes is
a)init
b)getty
c)
d)
e)none
(Ans is a)

33) PATH = /bin : /usr : /yourhome


The file /bin/calender has the following line in it
cal 10 1997
The file /yourhome/calender has the following line in it
cal 5 1997
If the current directory is /yourhome and calender is executed

a) The calendar for May 1997 will be printed on screen


b) The calendar for Oct 1997 will be printed on screen
c) The calendar for the current month( whatever it is) will be printed
d) Nothing will get printed on screen
e) An error massage will be printed

34) The standard source for standard input , standard output and standard error is
a) the terminal
b) /dev/null
c) /usr/you/input, /usr/you/output/, /usr/you/error respectively
d) NOne
Ans) a

35) The command


grep first second third /usr/you/myfile
a) prints lines containing the words first, second or third from thefile /usr/you/myfile

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b) searches for lines containing the pattern first in the files second, third, and
/usr/you/myfile and prints them
c) searches the files /usr/you/myfiel and third for lines containing the words first or
second and prints them
d) replaces the word first with the word second in the files third and
/usr/you/myfile
e) None of the above
Ans) b

36) In Unix inter process communication take place using?.

37).What are the files in /etc directory?.

38).About i-node numbers

39) Max relaxable permisssion value with out giving write permission
to others?.

40) A question on until


until (who |grep mary)
do
sleep(60)
done

41) very first process created by kernell

42)the condition required for dead lock in unix sustem is

43)set-user-id is related to (in unix)

44) bourne shell has


a)history record
b)
c)
d)

45) If a directory contains public files (can be valied and used


by any one ) which should not be altered ,the most liberal
permissions that can be given to the directory is
a)755
b)777
c)757
d)775
e)None of the above
(Ans a)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


C and C++
HCL

1.enum day = { jan = 1 ,feb=4, april, may}


what is the value of may?
a)4 b)5 c)6 d)11
e)none of the above

2.main
{
int x,j,k;
j=k=6;x=2; ans x=1
x=j*k;
printf("%d", x);

3. fn f(x)

{ if(x<=0)
return; ans fn(5) ....?
else f(x-1)+x;
}

4. i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}

printf("%d", k); ans k=4

5. int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i); ans i=20

6. int x=5;
y= x&y
( MULTIPLE CHOICE QS)
ans : c

7. Y=10;
if( Y++>9 && Y++!=10 && Y++>10)
printf("........ Y);
else printf("".... )
ans : 13

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


8. f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
d) ........

ans : a

9. if x is even, then
(x%2)=0
x &1 !=1
x! ( some stuff is there)

a)only two are correct


b) three are correct
c), d) ....
ans : all are correct

10. which of the function operator cannot be over loaded


a) <=
b)?:
c)==
d)*

ans: b and d

11.macros and function are related in what aspect? (HCL)


a)recursion b)varying no of arguments
c)hypochecking d)type declaration

12.preproconia.. does not do one of the following (HCL)


a)macro ...... b)conditional compliclation
c)in type checking d)including load file

13) STRUCT DOUBLELIST


{ DOUBLE CLINKED
INT DET; LIST VOID
STRUCT PREVIOUS; BE GIVEN AND A PROCEDURE TO DELETE
STRUCT NEW; AN ELEMENT WILL BE GIVEN
}
DELETE(STRUCT NODE)
{
NODE-PREV-NEXT NODE-NEXT;
NODE-NEXT-PREV NODE-PREV;
IF(NODE==HEAD)
NODE
}
IN WHAT CASE THE PREV WAS
(A) ALL CASES
(B) IT DOES NOT WORK FOR LAST ELEMENT
(C) IT DOES NOT WORK FOR-----
Ans:b
(14) SIMILAR TYPE QUESTION
ANS: ALL DON'T WORK FOR NON NULL VALUE

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(15) VOID FUNCTION(INT KK)
{
KK+=20;
}
VOID FUNCTION (INT K)
INT MM,N=&M
KN = K
KN+-=10;
}

16)
main()
{
int var=25,varp;
varp=&var;
varp p = 10;
fnc(varp)
printf("%d%d,var,varp);
}
(a) 20,55(b) 35,35(c) 25,25(d)55,55

17) What are the differences between Pascal and C.


Ans) Pascal is a strongly typed language.

18) int a=1,b=2,c=3;


printf("%d,%d",a,b,c);
What is the output?
19) The feature C++ have and c donot have
Variables can be declared inside also.
20) Floating point representation
2's complement
HUGHES
21) It is recommended to use which type of variables in a recursive module.
Ans. static variables.
22) proc() {

static i=10;
printf("%d",i);
}

If this proc() is called second time, what is the o/p Ans. 11

23. int arr[] = {1,2,3,4}


int *ptr=arr;
*(arr+3) = *++ptr + *ptr++;
Final contents of arr[] Ans. {1,2,3,4}

24. c programs
func() {
static int i = 10;
printf("%d",i);
i++;
}

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


what is the value of i if the function is called twice ?
Ans : 11
25) f(char *p)
{
p[0]? f(++p):1;
printf("%c",*p);
}
if call that fuction with f(Aabcd) what is the output??
ans:dcbaA (Just reversing the string

26) f(char *p)


{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the o/p???
ans:HELLO

27)Strings in Java
a)Mutable
b)variable length string
c)...
d)....

28)If "AaBbCc" is passed to the char


char x(*a)
{
a[0]?x(a+1):1;
printf("%c",a[0]);
return 1;
}
what will be the output?

29. f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
ans:bye

30) which is related to thread


a. separate switching reg

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b. " stack
c. " address space
31) in global static variable , declartion in a file
a. localization of scope
b. persistance of the value through out the file
32) about subroutine, precondition is false. what about post condition
a. post condition is not defined
b. post condition is always true

33) in product of x and y,


if(x=0|y=0)
y=1;
else
y=0;
(not cleared)
what is cyclometric complexity?
a. 3
b. 2
c. 1
d. 0

35)global variables in different files are


a:at compiletime
b) loading time
c) linking time
d)execution time

36)size of(int)
a) always 2 bytes
b) depends on compiler that is being used
c) always 32 bits
d) can't tell

37)which one will over flow given two programs


2
prog 1: prog2:

main() main()
{ {
int fact; int fact=0
long int x; for(i=1;i<=n;i++)
fact=factoral(x); fact=fact*i;

} }

int factorial(long int x)


{

if(x>1) return(x*factorial(x-1);
}

a) program 1;
b) program 2;
c) both 1 &2
d) none

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


}

37) variables of fuction call are allocated in


a) registers and stack
b) registers and heap
c) stack and heap
d)

38) main(){
char str[5]="hello";
if(str==NULL) printf("string null");
else printf("string not null");
}
what is out put of the program?
a) string is null b) string is not null c) error in program d) it executes but p
rint nothing

39) void f(int value){


for (i=0;i<16;i++){
if(value &0x8000>>1) printf("1")
else printf("0");
}
}
what is printed?
a) bineray value of argument b)bcd value c) hex value d) octal value

40)
void f(int *p){
static val=100;
val=&p;
}
main(){
int a=10;
printf("%d ",a);
f(&a);
printf("%d ",a);
}
what will be out put?
a)10,10

41)
struck a{
int x;
float y;
char c[10];
}
union b{
int x;
float y;
char c[10];
}
which is true?
a) size of(a)!=sizeof(b);
b)
c)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


d)

42)
# define f(a,b) a+b
#defiune g(c,d) c*d

find valueof f(4,g(5,6))


a)26 b)51 c) d)

43)
main()
{
char a[10]="hello";
strcpy(a,'\0');
printf("%s",a);
}
out put of the program?
a) string is null b) string is not null c) program error d)

44) char a[5][15];


int b[5][15];
address of a 0x1000 and b is 0x2000 find address of a[3][4] and b[3][4]
assume char is 8 bits and int is 32 bits

a) b) c) d)
45) main()
{
fork();
fork();
fork();
printf("\n hello");
}
How many times print command is executed?

46)main()
{
int i,*j;
i=5;
j=&i;
printf("\ni= %d",i);
f(j);

printf("\n i= %d",i);
}

void f(int*j)
{
int k=10;
j= &k;
}

output is
a 5 10
b 10 5
c55
d none

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


47) main()
{
int *s = "\0";

if(strcmp(s,NULL)== 0)
printf("\n s is null")p
else
printf("\n s is not null");
}

48) size of integer is


a. 2 bytes
b 4 bytes
c. machine dependant
d compiler dependent.

49) int a[5][4]


int is 2 bytes base address for array is 4000(Hexa)
what will be addr for a[3][4]?
int is 4 bytes same question.

IBM

50)what will be the result of executing following program


main
{
char *x="new";
char *y="dictonary";
char *t;
void swap (char * , char *);
swap (x,y);
printf("(%s, %s)",x,y);

char *t;
t=x;
x=y;
y=t;
printf("-(%s, %s)",x,y);
}
void swap (char *x,char *y)
{
char *t;
y=x;
x=y;
y=t;
}

a).(New,Dictionary)-(New,Dictionary)
b).(Dictionary,New)-(New,Dictionary)
c).(New,Dictionary)-(Dictionary,New)
d).(Dictionary,New)-(Dictionary,New)
e).None of the above
(Ans will be b or e) check

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


51).If a directory contains public files (can be valied and used
by any one ) which should not be altered ,the most liberal
permissions that can be given to the directory is
a)755
b)777
c)757
d)775
e)None of the above
(Ans a)

52) what would the following program results in


main()
{
char p[]="string";
char t;
int i,j;
for(i=0,j=strlen(p);i> {
t=p[i];
p[i]=p[j-i];
p[j-i]=t;
}
printf("%s",p);
}
a)will print:string
b)will not print anything since p will be pointing to a null string
c)will print:gnirtS
d)will result in a complication error
e)will print invallid characters(junk)
(Ans will be b ) check

53) After the following command is executed


$ ln old new
a listing is performed with the following output
$ ls -li

total 3
15768 -rw-rw-rw- 2 you 29 Sep 27 12:07 old
15768 " " " " " " " " new
15274 " " 1 " 40 " " 09:34 veryold

which of the following is true


a)old and new have same i-node number,2
b) " " " " " " " , 15768
c)old and new have nothing yo do with each other
d)very old and new are linked
e)very old and old are linked
(Ans is b)

54) What will be the result of executing the following statement


int i=10;
printf("%d %d %d",i,++i,i++);
a).10 11 12
b).12 11 10
c).10 11 11
d).result is OS dependent
e).result is compiler dependent

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(Ans is e)

55) What does extern means in a function declaration


a)the funct has global scope
b)the funct need not be defined\
c)nothing really
d)the funct has local scope only to the file it is defined in
e)none of the above
(Ans will be c)

56) What will be result of the following program


main()
{
void f(int,int);
int i=10;
f(i,i++);
}
void f(int i,int j)
{
if(i>50)
return;
i+=j;
f(i,j);
printf("%d,",i);
}
a).85,53,32,21
b)10,11,21,32,53
c)21,32,53,85
d)32,21,11,10
e)none of the above
(Ans is e)

57)What will be the result of the following program


main()
{
char *x="String";
char y[] = "add";
char *z;
z=(char *) malloc(sizeof(x)+sizeof(y)=1);
strcpy(z,y);
strcat(z,y);
printf("%s+%s=%s",y,x,z);
}
a)Add+string=Add string
b)syntax error during compilation
c)run time error/core dump
d)add+string=
e)none
(Ans will be e consider cap&small leters)

58)What does the following expression means?


char *(*(*a[N])())();
a) a pointer to a function returning array of n pointers to function
returning character pointers
b) a function return array of N pointers to funcions returning pointers
to characters

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c) an array of n pointers to function returning pointers to characters
d)an arrey of n pointers to function returning pointers to
functions returning pointers to characters
e) none of the above
(ANS IS d)

59)enum number { a=-1, b= 4,c,d,e}


what is the value of e ?
7,4,5,15,3
(ans is 7 ) check again

60) Result of the following program is


main()
{
int i=0;
for(i=0;i> {
switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}
a)0,5,9,13,17
b)5,9,13,17
c)12,17,22
d)16,21
e)syntax error
(Ans is d )

61) What is the result


main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c> printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i> printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2
b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none
(Ans is c)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


63) what will the following program do?
void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line no 15//

a) Swap contents of p & a and print:(New string, string)


b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1
Ans) b

64) In the following code segment what will be the result of the function,
value of x , value of y

{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
Ans) a

65) what will be the result of the following program ?


char *gxxx()
{
static char xxx[1024];
return xxx;
}

main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
Ans) b

66) What will be result of the following program?


void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
Ans) c ( check it )

67) What will be the result of the following program?


main()
{
char p[]="String";
int x=0;

if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}

a) Pass 1, Pass 2
b) Fail 1, Fail 2

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation

68) Which of the choices is true for the mentioned declaration ?


const char *p;
and
char * const p;
a) You can't change the character in both
b) First : You can't change the characterr &
Second : You can;t change the pointer
c) You can't change the pointer in both
d) First : You can't change the pointer &
Second : You can't chanage the character
e) None
Ans) b ( check it)

69) what will be the result of executing following program


main
{
char *x="new";
char *y="dictonary";
char *t;
void swap (char * , char *);
swap (x,y);
printf("(%s, %s)",x,y);

char *t;
t=x;
x=y;
y=t;
printf("-(%s, %s)",x,y);
}
void swap (char *x,char *y)
{
char *t;
y=x;
x=y;
y=t;
}

a).(New,Dictionary)-(New,Dictionary)
b).(Dictionary,New)-(New,Dictionary)
c).(New,Dictionary)-(Dictionary,New)
d).(Dictionary,New)-(Dictionary,New)
e).None of the above
(Ans will be b or e) check

70) what would the following program results in


main()
{
char p[]="string";
char t;
int i,j;
for(i=0,j=strlen(p);i> {
t=p[i];

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


p[i]=p[j-i];
p[j-i]=t;
}
printf("%s",p);
}
a)will print:string
b)will not print anything since p will be pointing to a null string
c)will print:gnirtS
d)will result in a complication error
e)will print invallid characters(junk)
(Ans will be b ) check

71) What will be the result of executing the following statement


int i=10;
printf("%d %d %d",i,++i,i++);
a).10 11 12
b).12 11 10
c).10 11 11
d).result is OS dependent
e).result is compiler dependent
(Ans is e)

72) What does extern means in a function declaration


a)the funct has global scope
b)the funct need not be defined\
c)nothing really
d)the funct has local scope only to the file it is defined in
e)none of the above
(Ans will be c)

73) What will be result of the following program


main()
{
void f(int,int);
int i=10;
f(i,i++);
}
void f(int i,int j)
{
if(i>50)
return;
i+=j;
f(i,j);
printf("%d,",i);
}
a).85,53,32,21
b)10,11,21,32,53
c)21,32,53,85
d)32,21,11,10
e)none of the above
(Ans is e)

74) What will be the result of the following segment of the program
main()
{
char *s="hello world";

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


int i=7;
printf("%.*%s",s);
}
a)syntax error
b)hello w
c) Hello
d) o world
e) none
(Ans is b)

75) What will be the result of the following program


main()
{
int a,b;
printf("enter two numbers :");
scanf("%d%d",a,b);
printf("%d+%d=%d",a,b,a+b);
}
a) will print the sum of the numbers entered
b) syntax error during compilation
c) will generate run time error /core dump
d) will print the string "a+b = a+b" on the screen
e) none of these
(Ans is c)

76) What is the size of 'q'in the following program?


union{
int x;
char y;
struct {
char x;
char y;
int xy;}p;
}q;
a)11
b)6
c)4
d)5
e)none
(Ans is b why because no of bytes for int =4 given in instructions)

77) What will be the result of the following program


main()
{
char *x="String";
char y[] = "add";
char *z;
z=(char *) malloc(sizeof(x)+sizeof(y)=1);
strcpy(z,y);
strcat(z,y);
printf("%s+%s=%s",y,x,z);
}
a)Add+string=Add string
b)syntax error during compilation
c)run time error/core dump
d)add+string=

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


e)none
(Ans will be e consider cap&small leters)
78)What does the following expression means?
char *(*(*a[N])())();
a) a pointer to a function returning array of n pointers to function returning character pointers
b) a function return array of N pointers to funcions returning pointers to characters
c) an array of n pointers to function returning pointers to characters
d)an arrey of n pointers to function returning pointers to
functions returning pointers to characters
e) none of the above
(ANS IS d)

79) enum number { a=-1, b= 4,c,d,e}


what is the value of e ?
7,4,5,15,3
(ans is 7 ) check again

80) Q) Result of the following program is


main()
{
int i=0;
for(i=0;i> {
switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}
a)0,5,9,13,17
b)5,9,13,17
c)12,17,22
d)16,21
e)syntax error
(Ans is d )

81) What is the result


main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c> printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i> printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none
(Ans is c)

82) In the process table entry for the kernel process, the process id value is
a) 0 b) 1 c) 2 d) 255 e) it does not have a process table entry
Ans) a

83) what will the following program do?


void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line no 15//

a) Swap contents of p & a and print:(New string, string)


b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1
Ans) b

84) In the following code segment what will be the result of the function, value of x , value of y
{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
Ans) a

85) What will be the result of the following program?


main()
{
char p[]="String";

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


int x=0;

if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}

a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation

86) Which of the choices is true for the mentioned declaration ?


const char *p;
and
char * const p;
a) You can't change the character in both
b) First : You can't change the characterr &
Second : You can;t change the pointer
c) You can't change the pointer in both
d) First : You can't change the pointer &
Second : You can't chanage the character
e) None
Ans) b ( check it)

87) The redirection operators > and >>

a) do the same function


b) differ : > overwrites, while >> appends
c) differ : > is used for input while >> is used for output
d) differ : > write to any file while >> write only to standard output
e) None of these
Ans) b

Optimize the below 1,2,3,4 questions for time:

1)
int i;
if i=0 then i:=1;
if i=1 then i:=0;

2)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


int i;
if i=0 then i:=1;
if i=1 then i:=0;
(given that i can take only two values (1,0))

3)
int i;
if i=0 then i:=1;
else if i=1 then i:=0;
(given that i can take only two values (1,0))

4)
int m,j,i,n;
for i:=1 to n do
m:=m+j*n

92) In the following questions, answer A,B,C,D depending on when


the errors are detected?
A if no error is detected
B if semantic and syntactic checking
C if during Code genration & Symbol allocation
D run time

a) Array overbound
b) Undeclared identifier
c) stack underflow
d) Accessing an illegal memory location

93) A question on call by value,


call by name,
call by reference.

f(x,y,z)
{
y := y+1;
z := z+x;
}
main()
{
int a,b;
a := 2
b := 2;
f(a+b,a,a);
print a;
}
what is the value of a printed for three different calls in main.

94) int i=0;


int j=0;

loop:
if(i = 0)
i++;
i++;
j++;
if(j<= 25)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


goto loop
xxx:
question1 : how many times is the loop entered
A few questions of that sort. some count fundaes. Easy one )

95) Max number of nodes in a binary tree with height 3 is 20 :


Ans: False

96) 10,20,30,40,50,60 : give the order when put in a queue and in a stack
Ans : Queue : 10,20,30,40,50,60
stack : 60,50,40,30,20,10

97) Debugging is the process of finding


Ans : logical and runtime errors

98) trace the error:


void main(){
int &a;
/* some other stuff here */
}
Ans: syntax error

99)a problem with a function named 'myValue' will be given and asked to
find the value of main() for an argument of 150,
Ans : 150

100) ex:define max 10


main()
{int a,b;
int *p,*q;
a=10;b=19;
p=&(a+b);
q=&max;
} Q a)error in p=&(a+b) b)error in p=&max c)error in both d) no error

MBT
101)
#include <stdio.h>
* What is wrong in the following problem
main() {
int i,j;
j = 10;
i = j++ - j++;
printf("%d %d", i,j);
}
ans: 0, 12

102)
#include <stdio.h>
* What is the output of the following problem
main() {
int j;
for(j=0;j<3;j++)
foo();
}
foo() {

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


static int i = 10;
i+=10;
printf("%d\n",i);
}

/* Out put is (***since static int is used i value is retained between


* 20 function calls )
* 30
* 40
*
/

103)
#include <stdio.h>
#include <stdio.h>
#include <string.h>
/* This is asked in PCS Bombay walk-in-interview
* What is wrong in the following code
*/
main()
{
char *c;
c = "Hello";
printf("%s\n", c);
}
/*ans:- Hello, The code is successfully running */

104)
#include <stdio.h>
/* This problem is given in PCS BOMBAY walk-in-interview.
* What is the final value of i and how many times loop is
* Executed ?
*/

main()

{
int i,j,k,l,lc=0;
/* the input is given as 1234 567 */
printf("Enter the number string:<1234 567 >\n");
scanf("%2d%d%1d",&i,&j,&k);
for(;k;k--,i++)
for(l=0;l<j;l++) { lc++;
printf("%d %d\n",i,l);}
printf("LOOPS= %d\n", lc-1);
}
/* Ans: i = 16, and loop is executed for 169 times */

105)
#include <stdio.h>
/* This is given in PCS Bombay walk-in-interview */
/* What is the output of the following program */

main() {
union {
int a;

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


int b;
int c;
} u,v;
u.a = 10;
u.b = 20;
printf("%d %d \n",u.a,u.b);
}
/* Ans : The latest value assigned to any of the union member
will be present in the union members so answer is
20 20
*/

106)
#include <stdio.h>
main()
{
float i, j;
scanf("%f %f", &i, &j);
printf("%.2f %.3f", i, j);
}

/Ans:- 123.34 3. 234 */

107)
#include <stdio.h>
/* This is given in PCS Bombay walk-in-interview
* What is the out put of the following problem ?
*/
main()
{
char *str = "12345";
printf("%c %c %c\n", *str, *(str++), *(str++));
}
/* Ans: It is not 1 2 3
* But it is 3 2 1 Why ??
*/

108)
#include <stdio.h>
/* This problem is asked in PCS Bombay Walk-in-interview
* Write a macro statement to find maximum of a,b
*/
#define max(a,b) (a>b)?a:b
main()
{
int a,b;
a=3;
b=4;
printf("%d",max(a,b));
}
/* Ans is very simple the coding is just for testing it
and output is 4 */

109)
#include <stdio.h>
/* This problem is asked in PCS Bombay

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


* What is the output of the following coding
*/

main()
{
int len=4;
char *st="12345678";
st = st -len;
printf("%c\n",*st);
}
/* Ans : It will print some junk value */

110)
#include <stdio.h>
main()
{
func(1);
}
func(int i){
static char *str ={ "One","Two","Three","Four"};
printf("%s\n",str[i++]);
return;
}
/* Ans:- it will give warning because str is pointer to the char but
it is initialized with more values
if it is not considered then the answer is Two */

111)
#include <stdio.h>
main()
{
int i;
for (i=1;i<100; i++)
printf("%d %0x\n",i,i);
}
/* Ans:- i is from 1 to 99 for the first format,
for the second format 1to9, ato f, 10 to 19,1ato1f, 20 to 29, etc */

113)
#include <stdio.h>
/* This problem is asked in PCS Bombay walk-in-interview
* In the following code please write the syntax for
* assing a value of 10 to field x of s and id_no 101 of s
*/
struct {
int x;
int y;
union {
int id_no;
char *name;
}b;
}s,*st;
main()
{
st = &s;
st->x=10;

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


st->b.id_no = 101;
printf("%d %d\n",s..x,s.b.id_no);
}
/* Ans: The answer is st->x=10;
* st->b.id_no=101;
*/

114)
#include <stdio.h>
/* This problem was asked in PCS Bombay in a walk-in-interview
* Write a recursive function that calculates
* n * (n-1) * (n-2) * ....... 2 * 1
*/

main() {
int factorial(int n);
int i,ans;
printf("\n Enter a Number:");
scanf("%d",&i);
ans = factorial(i);
printf("\nFactorial by recursion = %d\n", ans);
}
int factorial(int n)
{
if (n <= 1) return (1);
else
return ( n * factorial(n-1));
}

115)
#include <stdio.h>
/* This problem is asked in PCS Bombay walk-in-interview
* What is the output of the following problem
*/
main(){
int j,ans;
j = 4;
ans = count(4);
printf("%d\n",ans);
}
int count(int i)
{
if ( i < 0) return(i);
else
return( count(i-2) + count(i-1));
}

/* It is showing -18 as an answer */

116)
#include<stdio.h>
main()
{
int i=4;
if(i=0)
printf("statement 1");

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


else
printf("statement 2");
}
/* statement 2 */

This is pcsb paper.

117)
#include <stdio.h>
* What is wrong in the following problem

main() {
int i,j;
j = 10;
i = j++ - j++;
printf("%d %d", i,j);
}
ans: 0, 12

118)
#include <stdio.h>
* What is the output of the following problem
main() {
int j;
for(j=0;j<3;j++)
foo();
}
foo() {
static int i = 10;
i+=10;
printf("%d\n",i);
}

/* Out put is (***since static int is used i value is retained between


* 20 function calls )
* 30
* 40
*
/

119)
#include <stdio.h>
#include <stdio.h>
#include <string.h>
/* This is asked in PCS Bombay walk-in-interview
* What is wrong in the following code
*/
main()
{
char *c;
c = "Hello";
printf("%s\n", c);
}
/*ans:- Hello, The code is successfully running */

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


120)
#include <stdio.h>
/* This problem is given in PCS BOMBAY walk-in-interview.
* What is the final value of i and how many times loop is
* Executed ?
*/
main()

{
int i,j,k,l,lc=0;
/* the input is given as 1234 567 */
printf("Enter the number string:<1234 567 >\n");
scanf("%2d%d%1d",&i,&j,&k);
for(;k;k--,i++)
for(l=0;l<j;l++) { lc++;
printf("%d %d\n",i,l);}
printf("LOOPS= %d\n", lc-1);
}
/* Ans: i = 16, and loop is executed for 169 times */

121)
#include <stdio.h>
/* This is given in PCS Bombay walk-in-interview */
/* What is the output of the following program */

main() {
union {
int a;
int b;
int c;
} u,v;
u.a = 10;
u.b = 20;
printf("%d %d \n",u.a,u.b);
}
/* Ans : The latest value assigned to any of the union member
will be present in the union members so answer is
20 20
*/
122)
#include <stdio.h>
main()
{
float i, j;
scanf("%f %f", &i, &j);
printf("%.2f %.3f", i, j);
}

/Ans:- 123.34 3. 234 */

123)
#include <stdio.h>
/* This is given in PCS Bombay walk-in-interview
* What is the out put of the following problem ?
*/

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


main()
{
char *str = "12345";
printf("%c %c %c\n", *str, *(str++), *(str++));
}
/* Ans: It is not 1 2 3
* But it is 3 2 1 Why ??
*/

123)
#include <stdio.h>
/* This problem is asked in PCS Bombay Walk-in-interview
* Write a macro statement to find maximum of a,b
*/
#define max(a,b) (a>b)?a:b
main()
{
int a,b;
a=3;
b=4;
printf("%d",max(a,b));
}
/* Ans is very simple the coding is just for testing it
and output is 4 */

124)
#include <stdio.h>
/* This problem is asked in PCS Bombay
* What is the output of the following coding
*/
main()
{
int len=4;
char *st="12345678";
for(i=0; i<6; i++)
st = st -len;
printf("%c\n",*st);
}
/* Ans : It will print some junk value */

125)
#include <stdio.h>
main()
{
func(1);
}
func(int i){
static char *str ={ "One","Two","Three","Four"};
printf("%s\n",str[i++]);
return;
}
/* Ans:- it will give warning because str is pointer to the char but
it is initialized with more values
if it is not considered then the answer is Two */

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


126)
#include <stdio.h>
main()
{
int i;
for (i=1;i<100; i++)
printf("%d %0x\n",i,i);
}
/* Ans:- i is from 1 to 99 for the first format,
for the second format 1to9, ato f, 10 to 19,1ato1f, 20 to 29, etc */

127)
#include <stdio.h>
/* This problem is asked in PCS Bombay walk-in-interview
* In the following code please write the syntax for
* assing a value of 10 to field x of s and id_no 101 of s
*/
struct {
int x;
int y;
union {
int id_no;
char *name;
}b;
}s,*st;
main()
{
st = &s;
st->x=10;
st->b.id_no = 101;
printf("%d %d\n",s.x,s.b.id_no);
}
/* Ans: The answer is st->x=10;
* st->b.id_no=101;
*/
128)
#include <stdio.h>
/* This problem was asked in PCS Bombay in a walk-in-interview
* Write a recursive function that calculates
* n * (n-1) * (n-2) * ....... 2 * 1
*/

main() {
int factorial(int n);
int i,ans;
printf("\n Enter a Number:");
scanf("%d",&i);
ans = factorial(i);
printf("\nFactorial by recursion = %d\n", ans);
}
int factorial(int n)
{
if (n <= 1) return (1);

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


else
return ( n * factorial(n-1));
}

129)
#include <stdio.h>
/* This problem is asked in PCS Bombay walk-in-interview
* What is the output of the following problem
*/
main(){
int j,ans;
j = 4;
ans = count(4);
printf("%d\n",ans);
}
int count(int i)
{
if ( i < 0) return(i);
else
return( count(i-2) + count(i-1));
}

/* It is showing -18 as an answer */

130)
#include<stdio.h>
main()
{
int i=4;
if(i=0)
printf("statement 1");
else
printf("statement 2");
}
/* statement 2 */

131)Max value of SIGNED int


a. b. c. d.

132) One questin is given, long one, to find the answer U should be
femiliar with the operation as follows
int *num={10,1,5,22,90};
main()
{
int *p,*q;
int i;
p=num;
q=num+2;
i=*p++;
print the value of i, and q-p, and some other operations are there.
}
how the values will change?

133) One pointer diff is given like this:


int *(*p[10])(char *, char*)
asked to find the meaning.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


134)
char *a[4]={"jaya","mahe","chandra","buchi"};
what is the value of sizeof(a)/sizeof(char *)
a. 4 b.bytes for char c-- d.--
( we don't know the answer)

135) void fn(int *a, int *b)


{
int *t;
t=a;
a=b;
b=t;
}
main()
{
int a=2;
int b=3;
fn(&a,&b);
print the values os a and b;
}
what is the output--- out put won't swap, the same values remain.

a. error at runtime
b. compilation error
c.2 3
d. 3 2

136)
#define scanf "%s is a string"
main()
{
printf(scanf,scanf);
}
what is the output.

ANS : %s is string is string

137)
i=2+3,4>3,1;
printf("%d"i);
ans is 5 only.

138)
char *p="abc";
char *q="abc123";
while(*p=*q)
{
print("%c %c",*p,*q);
}
a. aabbcc
b. aabbcc123
c. abcabc123
d. infinate loop ( this may be correct)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


139)
printf("%u",-1)
what is the value?
a. -1 b. 1 c. 65336 d. --

(maxint value-1 I think, check for the answer)

140)
#define void int
int i=300;
void main(void)
{
int i=200;
{
int i=100;
print the value of i;
}
print the value of i
}
what is the output?

ans: may be 100 200

141)

int x=2;
x=x<<2;
printf("%d ",x);
ANS=8;

142)

int a[]={0,0X4,4,9}; /*some values are given*/


int i=2;
printf("%d %d",a[i],i[a]);
what is the value???
(may be error)

144) When the fn. is called where the return add. is stored?
ans. stack

145) What is the nece. for compiler to support recursion?


ans/ stack

146) swapping two variables x,y without using a temporary variable.

146) a program has been given asking to find the output


ans. it is algorithm for finding G.C.D

147) write a program for reversing the given string.

148) the integers from 1 to n are stored in an array in a random


fashion. but one integer is missing. write a program to find the
missing integer.
ans. idea. the sum of n natural numbers is = n(n+1)/2.
if we subtract the above sum from the sum of all the

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


numbers in the array , the result is nothing but the
missing number.
149)some bit type of questions has been given on pointers asking to
to find whether it is correct from syntax point of view. and if
it is correct explain what it will do.(around 15 bits).

150) . typedef struct{


char *;
nodeptr next;
} * nodeptr;
what does nodeptr stand for?

151) supposing thaty each integer occupies 4 bytes and each charactrer
1 byte , what is the output of the following programme?
#include<stdio.h>
main()
{
int a[] ={ 1,2,3,4,5,6,7};
char c[] = {' a','x','h','o','k'};
printf("%d\t %d ", (&a[3]-&a[0]),(&c[3]-&c[0]));
}
ans : 3 3

152) what is the output of the program?


#include<stdio.h>
main()
{
struct s1 {int i; };
struct s2 {int i; };
struct s1 st1;
struct s2 st2;
st1.i =5;
st2 = st1;
printf(" %d " , st2.i);
}

ans: nothing (error)


expl: diff struct variables should not assigned using "=" operator.

153) what is the output of the program?


#include<stdio.h>
main()
{
int i,j;
int mat[3][3] ={1,2,3,4,5,6,7,8,9};
for (i=2;i>=0;i--)
for ( j=2;j>=0;j--)
printf("%d" , *(*(mat+j)+i));
}

ans : 9 6 3 8 5 2 7 4 1

154)
fun(n);
}
int fun( int n)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


{
int i;
for(i=0;i<=n;i++)
fun(n-i);
printf(" well done");

}
howmany times is the printf statement executed for n=10?
ans: zero
expl: Befire reaching to printf statement it will goes to infinite loop.

155) what is the output of the program?


main()
{
struct emp{
char emp[];
int empno;
float sal;
};
struct emp member = { "TIGER"};
printf(" %d %f", member.empno,member.sal);

ans: error. In struct variable emp[], we have to give array size.


If array size given
ans is 0, 0.00

156) output of the program?


# define infiniteloop while(1)
main()
{
infiniteloop;
printf("DONE");
}
ans: none
expl: infiniteloop in main ends with ";" . so loop will not reach end;
and the DONE also will not print.

157) output of the program?


main()
{
int a=2, b=3;
printf(" %d ", a+++b);
}

ans:5
expl: here it evaluates as a++ + b.

158) output of the program?

#define prn(a) printf("%d",a)


#define print(a,b,c) prn(a), prn(b), prn(c)
#define max(a,b) (a<b)? b:a
main()
{
int x=1, y=2;
print(max(x++,y),x,y);

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


print(max(x++,y),x,y);
}
ans: 3 4 2

159) which of the following is the correct declaration for the function main() ?
ans: main( int , char *[])

160) if ptr is defined as


int *ptr[][100];
which of the following correctly allocates memory for ptr?

ans: ptr = (int *)(malloc(100* sizeof(int));

161) printf("%d%x\n",ox2,12);

162) int a=10;


int b=20;
a=a^b;
b=a^b;
a=a^b;
printf("%d%d\n",a,b);

163)enum
{ELLIPSE,
TRIANGLE,
RECTANGLE,
SQUARE=100,
CIRCLE=5
}
printf{"%d%d%d%d\n",TRIANGLE-RECTANGLE,SQUARE*CIRCLE-RECTANGLE};

164) define the following...


a) pointer to a integer
b) pointer to a char
c) function pointer returning a pointer integer.

165) void a(void);


main()
{
a();
}
void a(void)
{
char a="HELLOW";
char *b="HELLOW";
char c[10]="HELLOW";
printf("%s%s%s\n",a,b,c);
printf("%d%d%d\n",sizeof(a),sizeof(b),sizeof(c)));
}

166) int a=15;


int b=16;
printf("%d %d \n",a&b,a/b); (bitwise operators)
167) int a[5],*p;
for(p=a;p<&a[5];p++)
{

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


*p=p-a;
printf("%d\n",*p);
}

168) sscanf("xyz abc ABC 345" "% *[a-z A-Z]lf",&a);


printf("lf",a);

170)
main()
{
int i=10;
printf("%d",i);
{
int i=20;
printf("%d",i);
}
printf("%d",i);
}

171)struct class
{
int i;
float a;
string[12];
}
sizeof(class)=?

172) int *p;


i=10;
p=i;
printf("%d",*p);

173) fact(5)
int n;
fact(n)
{
sum=n*fact(n-1);
}

174)main()
{
char a[2];
*a[0]=7;
*a[1]=5;
printf("%d",&a[1]-a)
ANS:
ans may be 1.(illegal initialization)

175)
#include<stdio.h>
main(){
char a[]="hellow";
char *b="hellow";
char c[5]="hellow";
printf("%s %s %s ",a,b,c);
printf(" ",sizeof(a),sizeof(b),sizeof(c));

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


}
(ans is hellow,hellow,hellow
6,2,5 )
176)
#include<stdio.h>
main()

float value=10.00;
printf("%g %0.2g %0.4g %f",value,value,value,value)
}
(ans is 10,10,10,10.000000)

177)
#include<stdio.h>
void function1;
int i-value=100;
main()
{
i-value=50;
function1;
printf("i-value in the function=",i-value);
printf("i-value after the function=",i-value);
}
printf("i-value at the end of main=",i-value);
functioni()
i-value=25;

178)
main()
{
funct(int n);
{
switch(n)
case1:
m=2;
break;
case2:
m=5;
break;
case3:
m=7;
break;
default:
m=0;
}
THIS IS ROUGH IDEA:
(ANS:Out put is m=0)

179) 2.Java is
a. compiled
b. interpreted.
c. OOP
d. mutithreaded.
e. all
ans e.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


180) const char *
char * const
What is the differnce between the above tow?

181) n=7623
{
temp=n/10;
result=temp*10+ result;
n=n/10
}

Ans : 3267

182) C program code


int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15

Ans: b

183) In scanf h is used for (short int)


184) polymorphism(function &amp; operator overloading)
185)inheritance is(all properties of existing class are derived)
186) linked list is implemented by (referential structures)
187) copy constructor ( constant reference )
188)
n=3
do while(n<=6)
n=n-1;
n=n*(n+1)
end

189) if max() gives max of 3 nos, and min() min of 3 nos......


ans : 3

190) there is a flow chart consisting n,sum, and count


a condition is that : n > 10
ans: sum=45, n=11;

191)#define min((a),(b)) ((a)<(b))?(a):(b)


main()
{
int i=0,a[20],*ptr;
ptr=a;
while(min(ptr++,&a[9])<&a[8]) i=i+1;
printf("i=%d\n",i);} Ans:5.

192)main()
{char a[10]={1,2,3,4,5,6};int x;
for(x=0;x<4;x++){ b[x]=x+'a';}
printf("%s",b);} Ans:abcd56

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


193)Linked Lists are preffered than arrays to get advantage while
a)Insertion b)Deletion c)Accessing Element d)None
4)question on Stack
194)3 programs on recursion
195)~(~0<<8)? Ans:Last 8 digits are 1's rest are 0's.
196)int a,b=3,c=2;
a=b++*c;c=++b*a;Some thing like this.
print a,b,c? Ans:6,4,24

197)Virtual Functions in C++(Refer to 13'th chapter first two


examples of LAFORE Book)

198)Which of the following is not true regarding FRIEND function


Ans:If y is friend of x and z is friend of y then z can access
private of x.

199)Given some program on "&" operator overloading.

200)class X{
public:X(){ cout<<"This is Base";}
};
class Y:public X
{ public:Y(){cout<<"This is Derived";}};
what is printed when an object of Y is created?

201)
main()
{
int x=10,y=15;
x=x++;
y=++y;
printf("%d %d\n",x,y);
}

202)
int x;
main()
{
int x=0;
{
int x=10;
x++;
change_value(x);
x++;
Modify_value();
printf("First output: %d\n",x);
}
x++;
change_value(x);
printf("Second Output : %d\n",x);
Modify_value();
printf("Third Output : %d\n",x);
}

Modify_value()
{

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


return (x+=10);
}

change_value()
{
return(x+=1);
}

203)
main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}

204)
main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}

205)
main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}

206)
#define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}

207)
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}

208)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}

209)
#include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}

210)
#include<stdio.h>
main()
{
char *p1;
char *p2;
p1=(char *) malloc(25);
p2=(char *) malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}

211)
enum day = { jan = 1 ,feb=4, april, may}
what is the value of may?
a)4 b)5 c)6 d)11
e)none of the above
212)
main
{
int x,j,k;
j=k=6;x=2; ans x=1
x=j*k;
printf("%d", x);

212)
fn f(x)

{ if(x<=0)
return; ans fn(5) ....?
else f(x-1)+x;
}

213)
i=20,k=0;

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}
printf("%d", k); ans k=4

214)
int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i); ans i=20

215)
int x=5;
y= x&y
( MULTIPLE CHOICE QS)
ans : c

216)
Y=10;
if( Y++>9 && Y++!=10 && Y++>10)
printf("........ Y);
else printf("".... )
ans : 13

217)
f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
d) ........

ans : a

218) if x is even, then


(x%2)=0
x &1 !=1
x! ( some stuff is there)

a)only two are correct


b) three are correct
c), d) ....
ans : all are correct

219)
which of the function operator cannot be over loaded

a) <=
b)?:
c)==

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


d)*

ans: b and d

220) 2)#include<iostream.h>
main()
{
printf("Hello World");
}
the program prints Hello World without changing main() the o/p should
be
intialisation
Hello World
Desruct
the changes should be
a)iostream operator<<(iostream os, char*s)
os<<'intialisation'<<(Hello World)<<Destruct
b) c) d)none of the above

221) swap(int x,y)


{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}

222) static variable will be visible in


a)fn. in which they are defined
b)module " " " "
c)all the program
d)none

223)wrong statement about c++


a)code removably
b)encapsulation of data and code
c)program easy maintenance
d)program runs faster

224)struct base {int a,b;


base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none

225) for the above program answer the following q's


main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none

226)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-->x;
2)abc[0]-->x;
abc.x;
(abc)-->x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4

227) automatic variables are destroyed after fn. ends because


a)stored in swap
b)stored in stack and poped out after fn. returns
c)stored in data area
d)stored in disk
228) 1.main(argc,argv)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


{
if(argc<1)
printf("error");
else
exit(0);
}

229) What are the static variables...def

230) struct base {int a,b;


base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none

231) for the above program answer the following q's


main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


232)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-->x;
2)abc[0]-->x;
abc.x;
(abc)-->x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4

233) automatic variables are destroyed after fn. ends because


a)stored in swap
b)stored in stack and poped out after fn. returns
c)stored in data area
d)stored in disk

234) if a row daminated two dimentional arry in the following which one is advantage
and why?
a) for(i=0;i<1000;i++)
for(j=0;j<1000;j++)
temp=temp+a[i][j];
b) for(j=0;j<1000;j++)
for(i=0;i<1000;i++)
temp=temp+a[i][j]

235) what will be the result of executing following program


main
{
char *x=&quot;new&quot;;
char *y=&quot;dictonary&quot;;
char *t;
void swap (char * , char *);
swap (x,y);
printf(&quot;(%s, %s)&quot;,x,y);

char *t;
t=x;

x=y;
y=t;
printf(&quot;-(%s, %s)&quot;,x,y);
}
void swap (char *x,char *y)
{
char *t;
y=x;
x=y;
y=t;
}

a).(New,Dictionary)-(New,Dictionary)
b).(Dictionary,New)-(New,Dictionary)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c).(New,Dictionary)-(Dictionary,New)
d).(Dictionary,New)-(Dictionary,New)
e).None of the above

(Ans will be b or e) check

236) what would the following program results in


main()
{
char p[]=&quot;string&quot;;
char t;
int i,j;
for(i=0,j=strlen(p);i&lt;j;i++)
{
t=p[i];
p[i]=p[j-i];
p[j-i]=t;
}
printf(&quot;%s&quot;,p);
}
a)will print:string
b)will not print anything since p will be pointing to a null string
c)will print:gnirtS

d)will result in a complication error


e)will print invallid characters(junk)
(Ans will be b ) check
237.What does extern means in a function declaration
a)the funct has global scope
b)the funct need not be defined\
c)nothing really
d)the funct has local scope only to the file it is defined in
e)none of the above
(Ans will be c)

237) What will be result of the following program


main()
{
void f(int,int);
int i=10;
f(i,i++);
}
void f(int i,int j)
{
if(i&gt;50)
return;
i+=j;
f(i,j);
printf(&quot;%d,&quot;,i);
}
a).85,53,32,21
b)10,11,21,32,53
c)21,32,53,85
d)32,21,11,10
e)none of the above
(Ans is e)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


238) In the following code segment what will be the result of the function, value
of x , value of y
{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf(&quot;same&quot;);
else
printf(&quot;not same&quot;);
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
Ans) a

239) what will be the result of the following program ?


char *gxxx()
{
static char xxx[1024];
return xxx;
}
main()
{
char *g=&quot;string&quot;;
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,&quot;oldstring&quot;);
printf(&quot;The string is : %s&quot;,gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
Ans) b

234) What will be result of the following program?


void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g=&quot;String&quot;;
myalloc(g,20);
strcpy(g,&quot;Oldstring&quot;);
printf(&quot;The string is %s&quot;,g);
}
a) The string is : String
b) Run time error/Core dump

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
Ans) c ( check it )

241) What will be the result of the following program?


main()
{
char p[]=&quot;String&quot;;
int x=0;

if(p==&quot;String&quot;)
{
printf(&quot;Pass 1&quot;);
if(p[sizeof(p)-2]=='g')
printf(&quot;Pass 2&quot;);
else
printf(&quot;Fail 2&quot;);
}
else

{
printf(&quot;Fail 1&quot;);
if(p[sizeof(p)-2]=='g')
printf(&quot;Pass 2&quot;);
else
printf(&quot;Fail 2&quot;);
}
}

a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation

242) Which of the choices is true for the mentioned declaration ?


const char *p;
and
char * const p;
a) You can't change the character in both
b) First : You can't change the characterr &amp;
Second : You can;t change the pointer
c) You can't change the pointer in both
d) First : You can't change the pointer &amp;
Second : You can't chanage the character
e) None
Ans) b ( check it)

243)The C language terminator is


a.semicolon
b.colon
c.period
d.exclamation mark

244)What is false about the following

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


A compound statement is
a.A set of simple statments
b.Demarcated on either side by curly brackets
c.Can be used in place of simple statement
d.A C function is not a compound statement.

245) What is true about the following


C Functions
a.Need not return any value
b.Should always return an integer
c.Should always return a float
d.Should always return more than one value.

246)Main must be written as


a.the first function in the program
b.Second function in the program
c.Last function in the program
d.any where in the program

247) Which of the following about automatic variables within a function


is correct ?
a.its type must be declared before using the variable
b.they are local
c.they are not initialised to zero
d.they are global.

248) Write one statement equalent to the following two statements


x=sqr(a);
return(x);
Choose from one of the alternatives
a.return(sqr(a));
b.printf("sqr(a)");
c.return(a*a*a);
d.printf("%d",sqr(a));

249)Which of the following about the C comments is incorrect ?


a.commentscan go over multiple lines
b.comments can start any where in the line
c.a line can contain comments with out any language statements
d.comments can occur within comments

250)What is the value of y in the following code?


x=7;y=0;
if(x=6)
y=7;
else
y=1;
a.7
b.0
c.1
d.6

251) Read the function conv() given below


conv(int t)
{
int u;

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


u=5/9 * (t-32);
return(u0;
}
What
a.15
b.0
c.16.1
d.29

252) which of the following represents true statement


either x is inthe range of 10 and 50 or y is zero
a.x>=10 && x<=50 || y==0;
b.
c.
d.

253) Which of the following is not an infinite loop ?


a.while(1){
....
}
b.for(;;){
...
}
c.x=0;
do{
/*x unaltered within theloop*/
...
}while(x==0);
d.# define TRUE 0
...
while(TRUE){
....
}

254) what does the following function print?


func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}
a.3
b.1
c.0
d.2

255) how does the C compiler interpret the following two statements
p=p+x;
q=q+y;
a.p=p+x;
q=q+y

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b.p=p+xq=q+y
c.p=p+xq;
q=q+y
d.p=p+x/q=q+y

a.int
b.char
c.string
d.float

256) read the folllowing code


# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after executing this code?
a.200
b.1
c.-1
d.50

256)a memory of 20 bytes is allocated to a string declared as char *s


then the following two statements are executed:
s="Etrance"
l=strlen(s);
what is the value of l ?
a.20
b.8
c.9
d.21

255) given the piece of code


int a[50];
int *pa;
pa=a;
to access the 6th element of the array which of the following is incorrect?
a.*(a+5)
b.a[5]
c.pa[5]
d.*(*pa + 5)

256)consider the following structure:


struct num nam{
int no;
char name[25];
};
struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


a.8,9
b.9,9
c.8,8
d.8,unpredictable value

257) identify the in correct expression


a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;

258) regarding the scope of the varibles;identify the incorrect statement:


a.automatic variables are automatically initialised to 0
b.static variables are are automatically initialised to 0
c.the address of a register variable is not accessiable
d.static variables cannot be initialised with any expression

259) cond 1?cond 2?cond 3?:exp 1:exp 2:exp 3:exp 4;


is equivalent to which of the following?
a.if cond 1
exp 1;
else if cond 2
exp 2;
else if cond 3
exp 3;
else
exp 4;
b.if cond 1
if cond 2
if cond 3
exp 1;
else
exp 2;
else
exp 3;
else
exp 4;
c.if cond 1 && cond 2 && cond 3
exp 1 |exp 2|exp 3|exp 4;
d.if cond 3
exp 1;
else if cond 2
exp 2;
else if cond 3
exp 3;
else
exp 4;

260) the operator for exponencation is


a.**
b.^
c.%
d.not available

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


261) .which of the following is invalid
a.a+=b
b.a*=b
c.a>>=b
d.a**=b

262)what is y value of the code if input x=10


y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7

263) what does the following code do?


fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year

264) a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6

265) how many times does the loop iterated ?


for (i=0;i=10;i+=2)
printf("Hi\n");
a.10
b.2
c.5
d.....

266) what is incorrect among teh following


A recursive functiion
a.calls itself
b.is equivalent to a loop
c.has a termination cond
d.does not have a return value at all

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


267) which of the following go out of the loopo if expn 2 becoming false
a.while(expn 1){...if(expn 2)continue;}
b.while(!expn 1){if(expn 2)continue;...}
c.do{..if(expn 1)continue;..}while(expn 2);
d.while(!expn 2){if(expn 1)continue;..}

268)consider the following program


_B_______
main()
_OB {unsigned int i=10;
while(i>=0){
printf("%u",i)
i--;
}
}
how many times the loop wxecuted
a.10
b.9
c.11
d.infinite

269) pick out the add one out


a.malloc()
b.calloc()
c.free()
d.realloc()

270)consider the following program


main()
{
int a[5]={1,3,6,7,0};
int *b;
b=&a[2];
}
the value of b[-1] is
a.1
b.3
c.-6
d.none

271)
# define prod(a,b)=a*b
main()
{
int x=2;
int y=3;
printf("%d",prod(x+2,y-10)); }

the output of the program is


a.8
b.6
c.7
d.none

272)consider the following program sigment


int n,sum=1;

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


switch(n) {
case 2:sum=sum+2;
case 3:sum*=2;
break;
default:sum=0;}
if n=2, what is the value of sum
a.0
b.6
c.3
d.none

273)identify the incorrect one


1.if(c=1)
2.if(c!=3)
3.if(a<b)then
4.if(c==1)
a.1 only
b.1&3
c.3 only
d.all

274)teh format specified for hexa decimal is


a.%d
b.%o
c.%x
d.%u

275)find the output of the following program


main()
{
int x=5, *p;
p=&x;
printf("%d",++*p);
}
a.5
b.6
c.0
d.none

276)consider the following C code


main()
{
int i=3,x;
while(i>0)
{
x=func(i);
i--;
}
int func(int n)
{
static sum=0;
sum=sum+n;
return(sum);
}
the final value of x is
a.6

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b.8
c.1
d.3

277)int *a[5] refers to


a.array of pointers
b.pointer to an array
c.pointerto a pointer
d......

278)which of the following statements is incorrect


a.typedef struct new{
int n1;
char n2;
} DATA;
b.typedef struct {
int n3;
char *n4;
}ICE;
c.typedef union {
int n5;
float n6;
} UDT;
d.#typedef union {
int n7;

float n8;
} TUDAT;
279) CHAR A[10][15] AND INT B[10][15] IS DEFINED
WHAT'S THE ADDRESS OF A[3][4] AND B[3][4]
IF ADDRESS OD A IS OX1000 AND B IS 0X2000

A. 0X1030 AND 0X20C3


B. OX1031 AND OX20C4
AND SOME OTHERS..

280) int f(int *a)


{
int b=5;
a=&b;
}

main()
{
int i;
printf("\n %d",i);
f(&i);
printf("\n %d",i);
}

what's the output .

1.10,5
2,10,10
c.5,5
d. none

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


281) main()
{
int i;
fork();
fork();
fork();
printf("----");
}

how many times the printf will be executed .


a.3
b. 6
c.5
d. 8

6.
void f(int i)
{
int j;
for (j=0;j<16;j++)
{
if (i & (0x8000>>j))
printf("1");
else
printf("0");
}
}
what's the purpose of the program

a. its output is hex representation of i


b. bcd
c. binary
d. decimal

282)
#define f(a,b) a+b
#define g(a,b) a*b
main()
{

int m;
m=2*f(3,g(4,5));
printf("\n m is %d",m);
}

what's the value of m


a.70
b.50
c.26
d. 69

283)
main()
{

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


char a[10];
strcpy(a,"\0");
if (a==NULL)
printf("\a is null");
else
printf("\n a is not null");}

what happens with it .


a. compile time error.
b. run-time error.
c. a is null
d. a is not null.

284)
char a[5]="hello"
a. in array we can't do the operation .
b. size of a is too large
c. size of a is too small
d. nothing wrong with it .

285) local variables can be store by compiler


a. in register or heap
b. in register or stack
c .in stack or heap .
d. global memory.

286) global variable conflicts due to multiple file occurance


is resolved during
a. compile-time
b. run-time
c. link-time
d. load-time
287)two program is given of factorial.
one with recursion and one without recursion .
question was which program won't run for very big no. input because
of stack overfow .
a. i only (ans.)
b. ii only
c. i& ii both .
c. none
288)
struct a
{
int a;
char b;
int c;
}

union b
{
char a;
int b;
int c;
};
which is correct .
a. size of a is always diff. form size of b.(ans.)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b. size of a is always same form size of b.
c. we can't say anything because of not-homogeneous (not in ordered)
d. size of a can be same if ...
289)
#define SUM(a,b) a+b
main()
{
a=2;
b=3;
x=SUM(a,b)*2;
printf("x=%d\n",x);
}
Ans:8.

290)number(int i)
{
number++;
printf("%d\n",number);
}
main()
{
static int i=0;
number(i);
}
Ans: I don't know

291) main()
{
unsigned char i;
int sum;

for(i=0; i<300; i++)


sum+ = i;
printf("\nSum = %d\n", sum);
}
Ans : infinite loop

292) void fn(int *p)


{
static int val = 100;
p = &val;
}

main()
{
int i=10;
printf("i=%d\n", i);
fn(&i);
printf("i=%d\n", i);
}
Ans : i=10 i=10

293) Swapping without using a temporary variables. (2 methods)


(i) x = x+y;
y = x-y;
x = x-y;

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(ii) x = x^y;
y = x^y;
x = x^y;

294) main()
{
int a[10] = {1, 2, 3, ...., 10}, i, x=10, temp;

for(i=0; i<x; i++){


temp = a[i];
a[i] = a[x-i-1];
a[x-i-1] = temp;
}
(i) All contents of array a are reversed
(ii) Only some portions are altered
(iii) Remains same
(iv) None
Ans : (iii)

295) An array is stored in row major order. The memory capacity is


30 MB. And in unix system demand paging is used. Which one will
give more page faults?
#define V_L_I 10000
int i, j, array[V_L_I][V_L_I];
Code 1 :
array[i][j] = 1;

Code 1 :
for(j=0; j<V_L_I; j++)
for(i=0; i<V_L_I; i++)
array[i][j] = 1;

Ans : Code 2

(296) In C which parameter passing technique is used?


(i) call by value,
(ii) call by reference,
(iii) both
Ans : call by value

297) main()
{
int i = 1;
fork();
fork();
printf("\ni = %d\n", i+1);
}
Ans : 4 printfs will occur and i = 2

298) # define MAX(a, b) a>b ? a:b


main()
{
int m, n;
m = 3 + MAX(2, 3);
n = 2 * MAX(3, 2);

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


printf("m = %d, n = %d\n", m, n)
}

Ans : m=2, n=3

299) 1.int a=2,b=3,c=4;


printf("a=%d,b=%d\n",a,b,c);
ANS:2,3

300)for(i=1;i<10;++i,printf("%d",i));+-
ANS:compiling error.

301)whole logic is given in func s but they are working properly.


the main logic is :

char *string;
string=malloc(5*sizeof(char));
strcpy(string,"hello");
printf("%s",string); /* func to print */

ANS:hello and some extra characters until uccerence of \0 .

302) in a system integer takes 3bytes and char takes 1byte .......
struct smthing{
int a;
char b[4];
};

303) Which of the following language is a functional language


a) RPG
b) Small Talk
* c) PI/I
d) LISP
ANS:sizeof struct smthing is 7 bytes.\

304)Which is pure object oriented language?


a) Effiel
b) c++
c) object pascal
* d) Small talk

305) corba stands for ...


* a. common object request broker architecture
b. combined recovery based system
c. code recovery bench architecture
d. none of the above

306)which is non-procedural language?


* a. effiel
b. ada
c. small talk
d. sql

307)which of the following language supports associative arrays?


a. pl/i
b. rpg

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


* c.perl
d. ada
308) FORTRAN implimentation do not permit recursion because
* a) they use static allocation for variables
b) &quot; dynamic &quot; &quot;
c) stacks are not avalible on all machines
d) it is not possible to impliment recursion on all m/c s

309) what does the following code do


var a,b :integer
begin
a :=a+b
b :=a-b
a :=a-b
end;
* a) exchange a and b
b) doubles a and stores in b
c) &quot; b &quot; a
d) leaves a and b unchanged
e) none

310) for program segament given bellow, which of the follwing are true?
program main(output)
type link = ^data
data = record
d : record
n : link
end;
var ptr : link;
begin
new(ptr);
ptr :=nil;
ptr ^.d :=5.2
written(ptr);
end;
a) the programme leads to compile time error
b) &quot; &quot; run &quot; &quot;
c) the programme produces error relating to nil pointer dereferencing
e) both b and a

311) what is the output of the program segament belowif the compiler operates
call byreference?
procedure CALC(P,Q,R);
begin
Q:=Q-1.0
R:=Q+P
end;
begin{main}
A:=2.5; B:=9.0;
CALC(B-A,A,A);
print(A);
end; {main}

a) 1.5
b) 2.5
c) 10.5

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


* d) 8
e) 6.5

312) Which of the following is not provided in C?


a) test loops
b) grouping and subprograms
* c) synchronization, coroutines,and parallel processing
e) all the above

313) What will be the value of x and y after execution of the follwing
statment ( C language)
n== 5; x = n++; y = --x;
a) 5,4
b) 6,5
c) 6,6
* d) 5,5

314) consider the function below:


function calc(x,y:integer):integer;
begin
if y=1
then calc:=x
else calc:=calc(x,y-1)+x
end;

315)assuming that the invocation call is &quot;calc(a,b)&quot;and that &quot;a&quot;and


&quot;b&quot;are
positive integers,what result does this function return?
a. a*(b-1)
b. a*b
c. a+b
d. a power b
e. a*b

316) to reverse a string using a recursive function, without


swapping or using an extra memory
.
317)To reverse a linked list as above.
318)given a macro like
#define MAX(A,B) {to return that is larger}
what will MAX(i++,j),MAX(i,j++) return.

319)Difference between Macro and ordinary definition.


320)Difference between Class and Struct.
321) int a=1,b=2,c=3;
printf("%d,%d",a,b,c);
What is the output?

322) Scope of Static Variable ............


in a file.

323) typedef struct{


char *;
nodeptr next;
} * nodeptr;
what does nodeptr stand for?

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


ans:

324) 2 oranges,3 bananas and 4 apples cost Rs.15 . 3 ornages 2 bananas


1 apple costs Rs 10. what is the cost of 3 oranges, 3 bananas and
3 apples
ANs Rs 15.

335) int *x[](); means


Ans:expl: Elments of an array can't be functions.

326) struct list{


int x;
struct list *next;
}*head;
the struct head.x =100
Ans: above is correct / wrong
expl: Before using the ptr type struct variable we have to give memory
to that .And also when ever the struct variable is ptr then we access the members by "->" operator.

327)o/p=?
int i;
i=1;
i=i+2*i++;
printf(%d,i);
ans: 4

328) FILE *fp1,*fp2;


fp1=fopen("one","w")
fp2=fopen("one","w")
fputc('A',fp1)
fputc('B',fp2)
fclose(fp1)
fclose(fp2)}
a.error b. c. d.
ans: no error. But It will over writes on same file.

329)#include<malloc.h>
char *f()
{char *s=malloc(8);
strcpy(s,"goodbye")}
main()
{
char *f();
printf("%c",*f()='A');
o/p=?

330) #define MAN(x,y) (x)>(y)?(x):(y)


{ int i=10;j=5;k=0;
k= MAX(i++,++j)
printf(%d %d %d %d,i,j,k)}
ans:10 5 0
331)
a=10;b=5; c=3;d=3;
if(a<b)&&(c=d++)
printf(%d %d %d %d a,b,c,d)
else printf("%d %d %d %d a,b,c,d);

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


ans:

332)
what is o/p
#include<stdarg.h>
show(int t,va_list ptr1)
{
int a,x,i;
a=va_arg(ptr1,int)
printf("\n %d",a)
}
display(char)
{int x;
listptr;
va_star(otr,s);
n=va_arg(ptr,int);
show(x,ptr);
}
main()
{
display("hello",4,12,13,14,44);
}
a) 13 b) 12 c) 44 d) 14

333)
main()
{
printf("hello");
fork();
}
ans:

334)
main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}
ans:

335)
#include<stdio.h>
main()
{
int *p, *c, i;
i = 5;
p = (int*) (malloc(sizeof(i)));
printf("\n%d",*p);
*p = 10;
printf("\n%d %d",i,*p);
c = (int*) calloc(2);
printf("\n%d\n",*c);
}
ans:

336)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


#define MAX(x,y) (x) >(y)?(x):(y)
main()
{
int i=10,j=5,k=0;
k= MAX(i++,++j);
printf("%d..%d..%d",i,j,k);
}
ans:

337)
#include <stdio.h>
main()
{
enum _tag{ left=10, right, front=100, back};
printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back);
}
ans:

338)
main()
{
int a=10,b=20;
a>=5?b=100:b=200;
printf("%d\n",b);
}
ans:

339)
#define PRINT(int) printf("int = %d ",int)
main()
{
int x,y,z;
x=03;y=02;z=01;
PRINT(x^x);
z<<=3;PRINT(x);
y>>=3;PRINT(y);
}
ans:

340)
#include<stdio.h>
main()
{
char s[] = "Bouquets and Brickbats";
printf("\n%c, ",*(&s[2]));
printf("%s, ",s+5);
printf("\n%s",s);
printf("\n%c",*(s+2));
}
ans:

341)
main()
{

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


struct s1
{
char *str;
struct s1 *ptr;
};
static struct s1 arr[] = { {"Hyderabad",arr+1},
{"Bangalore",arr+2},
{"Delhi",arr}
};
struct s1 *p[3];
int i;
for(i=0;i<=2;i++)
p[i] = arr[i].ptr;

printf("%s\n",(*p)->str);
printf("%s\n",(++*p)->str);
printf("%s\n",((*p)++)->str);
}
ans:

342)
main()
{
char *p = "hello world!";
p[0] = 'H';
printf("%s",p);
}
ans:
343)m=3 while (m&lt;18) do {m=m+2;m=m-1}
ans:15

344)m=1;a=30;while (m&lt;&gt;1) do {m=m+1;a=a-1;}

345)m=1;a=30;while (e*m-5&lt;a) do {m=m+1;a=a-2}


ans:9

346)in questions 8 to 12 find the values of a and b at the end of the


xecution of the program segment

347)a=2;b=1;x=1;while(x&lt;=4)do {a=a+b;x=x+1}
ans:(5,1)34*)

348)a=1;b=2;x=1 while (x&lt;=5)do {b=a+b;x=x+1;}


ans:(1,6)

349)a=0;b=0;x=1;while (x&lt;=4){a=a+x;b=b-x;x=x+1;}
ans:(10,-10)

350) # define TRUE 0


some code
while(TRUE)
{
some code

}
This won't go into the loop as TRUE is defined as

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


Data Structures
HCL
1.What data structes you will use if you want to go to first record from
the last and vice versa?
ans.: doubly linked circular list

2. given a height balanced tree. If we add one more node , how


many nodes gets unbalanced ? Ans. 3

3. Given a arbitrary pointer to an element in a singly linked list?


what is the time complexity for its deletion . Ans. O(n)

4. S->S+S; s->s*s; s->a


how many parse trees possible : a+a*a+a Ans. 5

5. order of Hashing time

6) A choclate of size nXn is given and is to be made into pices of size 1x1. At a time both
horizontal and a vertical cut is done. Find the order of complexity
a) 0(n2)
b) o(nlogn)
c) o(logn)
Ans : a

7) comparison between hashtable and binary tree

HUGHES

8) No. of nodes of degree 2 in a binary tree with n leaf nodes.


Ans. n-1

9. To sorting array of 10 elements which sorting is best


a)slection
b)bubble
c)tree sort
d)....
ans:a

10 To saving space point of view which sort is best


a)selection
b)insertion
c)both a & b
d)...

11Which statement is wrong on heap

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


a)Any two childs should not same
b)..
c)..
d)...
ans:a

12) cyclometric complexity..

13) how many null pointer are there in N number binary tree
ans:N+1

14) Two sorted list of size n what are the maximum comparison in merge
ANs:2n-1

15) two sorted lists of n elements will take at least


fine the order of complexity?
a. 2n
b. n/2
c. square(n)

16)if there are n nodes in a binary tree, how many null pointers are
there
ans:n+1;

17). if heap sort contains n elements, no of comparsions required are


a. log(n)
b. height of heap sort
c.
d.

18) which of the following is efficient in terms of space


a. insertion sort
b. quick sort
c. selection
d. both a and c

19) in sorted table contains elements , which of the searching is


false
a. hash table
b. binary searching

20) in associated memory for fast accessing


which one is used
a. single linked list
b. double "
c. hash table

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


21) for hashing which is best on terms of buckets
a)100 b)50 c)21 d)32 ans 32

22) max and avg. height of sorted binary tree


a. logn n
b n logn

23) implementation of priority queue


a. tree
b linked list
c doubly linked list

24) For a binary tree with n nodes, How many nodes are there which
has got both a parent and a child?

25) Bubble sort : Given sequence of numbers what will be order of sequences
after two iterations.
Ans: very trivial, but you should know what bubble sort
does.

26)Bubble sort : how many swap operations has been done in the above
process?

27)What data structures you should use for dictionary searching and it
should be capable of doing spell check also ?
Ans: Hashing

28)Which is the best scheduling algo. (given five of them)


Ans.: Shortest Job First with Pre-emption

29) Bubble sort is given ., No of times it executes


ans . n(n-1)/2

30) The appriximate ratio for no of internal nodes to total no

31) precedence order from high to low ( ( ) ++ / )

32) preorder of A*(B+C)/D-G (*+ABC/-DG)

33) B-tree (failure nodes at same level)


of nodes in k-ary tree of depth n.
ans. 1/k

34) merge sort time complexity ( O(n log n) )

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


35) while following sorting algorithem has average sorting behavior (heap
sort )

36)in binary search tree which traversal is used for getting ascending
order values (inorder )

37) fun(n)
{
if(n<=2)
return (1);
else
return ((fun(n-1)*fun(n-2));
}
find the order of complexity of the programme.
possible answer ---- N(2^n)

38). average and worst time complexity in a sorted binary tree is

39) a tree is given and ask to find its meaning (parse-tree)


(expression tree)
ans. ((a+b)-(c*d)) ( not confirmed)

40) Compute the complexity of Binary search.


Ans : O(lg n) ( Answer in detail. This is not a multiple choice question.
It carries more marks.)

41) A search procedure which assosiates an address with a key value and
provides a mechanism for dealing with two or more values assigned to the
same address to the same address is called.
a) linear earch
b) binary search
* c) hash coded search
d) radix search

42)which data struture is needed to convert infix notations to postfix


notations?
a. linear list
b. queue
c. tree
d. stack ans:d

43) recursive procedures are implemented by


a.queues
b.stacks
c.linked lists
d.strings

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


44) A linear list of elments in which deletion can be done from one end (front)and
insertion can take place only at the other end(rear)is known as
*a) queues
b)stacks
c)trees
d)deque

45) A linear list in which elements can be added or removed at either


end but not in the middle is known as
a)queue
*b)deque
c)stack
d)tree

46)which of the following sorting procedure is slowest


a)quick sort
b)heap sort
c)shell sort
*d)bubble sort

47) The complexity of bublle sort is0(a),then kequals


ans:2

48) given a height balanced tree. If we add one more node , how
many nodes gets unbalanced ? Ans. 3

49) Given a arbitrary pointer to an element in a singly linked list?


what is the time complexity for its deletion . Ans. O(n)

50) S->S+S; s->s*s; s->a


how many parse trees possible : a+a*a+a Ans. 5

51) order of Hashing time

52) A choclate of size nXn is given and is to be made into pices of size 1x1. At a time
both horizontal and a vertical cut is done. Find the order of complexity
a) 0(n2)
b) o(nlogn)
c) o(logn)
Ans : a

53) comparison between hashtable and binary tree


Micro Processor

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


1....... 25MHz processor , what is the time taken by the instruction which needs 3 clock
cycles,(HCL)
a)120 nano secs b)120 micro secs
c)75 nano secs d)75 micro secs

2. For 1 MBmemory no of address lines required, (HCL)


a)11 b)16 c)22 d) 24
ans: 16

3.No given in HEX ---- write it in OCTAL (HCL)


hughes
4. Using which pin it's possible to address 16 bit addresses even though there
are only 8 address bits in 8085? Ans: ALE

5. resistance increases with temperature in a) Metal b) semiconductor


What is the O/P voltage wen i/p is 1 volt

6. Quality factor indicates a0 Quality of inductor b) quality of capacitor


c) both

7. Security functionality is provided by which layer of OSI

8. Frequency spectrums for AM, FM and PM (figure given, u'veto tell which
Kind of modulation it belongs to)

9. Among AM and FM which is better and why?


SR to JK flip flop conversion. Ans: S=JQ', R=KQ

10. LSB of a shift register is connected to its MSB, what is formed: Ans:
RING Counter

11. 2-3 Qns based on Demorgan's laws (identiies: (A+b)' = A'b', etc)

12. 2 qns on Logic gates (O/p of logic gates)

13 Qn on pipeline architecture

14. Main memory cache direct mapping


Ans : 64

15. Address lines and data lines for 4K x 16


Ans : Addr 12, Data 16

16. Difference between syachronous and asynchronous transmission

17. Vector intr mechanism. in 8085.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


Ans. fixed locations in memory when an intr comes.

18. qn. on karnaugh map for simplifying boolean expressions

-11-
1--1
1--1
-11-
karnaugh map

19 pc is incremented while executing ---------- instruction


ans:fetch instruction

20 this is gates (NAND)problem


It means some gate figure has given with all NAND gate we have write
equavalent gate
ans:OR gate

21) no.of filpflops for mod 11 counter


a.four
b.five
c.

22). no of comparators required for 4 bit parallel A/D comparator


a. 4
b. 16
c. 15
d. none

23) CPU have one interrupt pin and on to connect with external
devices with some priority?
which type of the following is used?
a. parallel priority interrupt
b. daisy chain
c. RS filpflop
d.

24) in 32 bit representation, the range of numbers in 2's complement


form
ans :-2 to the power of 31 to 2 to the power of 31 minus 1

INTERGA
25) If a CPU has 20 address lines but MMU does'nt use two of them.
OS occupies 20K. No virtual memory is supported. What is the
maximum memory available for a user program
26) Using the following instructions and two registers , A&B.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


find out A XOR B and put the result in A
PUSH <reg>
POP <reg>
NOR These instructions operates with A & B and puts the result in
AND A

(question basically to get XOR in terms of NOR and AND)

27) Mod K ring counter requres how many number of flipflops.Ans:K

28) diff between 8087,8086 (which is latest vers.)

29) 2's complement of a 2's complement number is


ans . same no.

30) If a channel has 2400 bauds what is the data rate it support.
check in data commn book stalins

31)if Band width is w what is data rate


ans 2w

32) A 12 address lines maps to the memory of


[a] 1k bytes [b] 0.5k bytes [c] 2k bytes [d] none
Ans: b

33) In a processor these are 120 instructions . Bits needed to impliment


this instructions
[a] 6 [b] 7 [c] 10 [d] none
Ans: b

34) In 8085 microprocessor READY signal does.which of the following


is incorrect statements
[a]It is input to the microprocessor
[b] It sequences the instructions

Ans : b

36) Return address will be returned by function to


[a] Pushes to the stack by call
Ans : a

37) In a compiler there is 36 bit for a word and to store a character 8bits are needed. IN
this to store
a character two words are appended .Then for storing a K characters string, How many
words are needed.
[a] 2k/9 [b] (2k+8)/9 [c] (k+8)/9 [d] 2*(k+8)/9 [e] none

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


37) .for a given CMOS the voltage is halved
freqency doubled
capacitance halved

38)what is the present CMOS power


ans (b)---- dynamic power is 1/2 *C*f*V^2
instructions respectively then no. of cycles will be
a. 5 and 12
b. 6 and 13
c. 9 and 16
d.none

39) k-map
ab
----------
c 1 x 0 0
1 x 0 x

solve it

a. A.B
B. ~A
C. ~B
D. A+B

40) int a[10[15];


char b[10[15];
(a) location g a[3][4], if base location g a[0][0] is ox1000
(b) location g b[3][4], if base location g b[0][0] is ox2000
int taken 32 bits and char taken 8 bits.
Ans : (a) ox10C4 (b) ox2031

41) Implement OR gate function with 2*1 MUX


Ans : A ___________
--------|2*1 MUX |
B | |--------o/p
--------| |
| -----------
|_______|C

B=C

42) 1.A logic ckt is given and asked to identify the configuration.
ANS: XOR.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


43)multi vibrator with nor gates is given
ANS: astable multi sqr wave opt.

44) 4 stage ripple counter with delay(f/f) 10msec. How much time it takes
for a state to change.
ANS:4*10=40.

45)impedence of a parallell resonant circiut at resonance:


ANS:R.

46)serial to parellel conversion is done by :


ANS:shift register.

47) if the address bus is 20bits.then the memory space is :


ANS:1MB.

48) filtering can be done with:


i)capacitor,ii)inductor,iii)both,iv)none.
ANS:both.

49) two progs are given. one satrts counting frm 0 to MAX and the other
stars frm MAX to 0. which one executes fast.
ANS:may be Max to 0.Think of it.

50)problem using three registers.


ANS: register A is multiplied by 11.

51) the config that is worst effected by low CMMR


ANS:Non inverting amplifier.

52) What is the binary equivalent of dicimal 269?


a) 100001100
b) 100001010
c) 101001011
* d) 100001101

53) EE-ROM is
* a) electricity erasable
b) easily &quot;
c) non &quot;
d) effective &quot;

54) microprocessors can be used to make


a. computers
b.calculators
c.digital systems

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


*d.all the above

55) 1.A logic ckt is given and asked to identify the configuration.
ANS: XOR.

56)multi vibrator with nor gates is given


ANS: astable multi sqr wave opt.

57)4 stage ripple counter with delay(f/f) 10msec. How much time it takes
for a state to change.
ANS:4*10=40.

58)impedence of a parallell resonant circiut at resonance:


ANS:R.

59)serial to parellel conversion is done by :


ANS:shift register.

60)if the address bus is 20bits.then the memory space is :


ANS:1MB.

61) filtering can be done with:


i)capacitor,ii)inductor,iii)both,iv)none.
ANS:both.

62) two progs are given. one satrts counting frm 0 to MAX and the other
stars frm MAX to 0. which one executes fast.
ANS:may be Max to 0.Think of it.

66) problem using three registers.


ANS: register A is multiplied by 11.

67) the config that is worst effected by low CMMR


ANS:Non inverting amplifier.

68)A Circuit with nand gates. (ans. may be XOR)

69) CMRR. relates to (options not in order)


voltage follower
non invering amplifier
inverting amplifier
integrator

70)Given a circuit , give the ouput.


(ans. may be triangular wave.)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


71) o/p of an assembly code.
mulitply by 11.

72) how to handle asynchronous events.


a) polling
b) interrrupt
etc.

73) 2.Truth table of a logic function


ans: displays all its input output possibilities

74) The process of varying one signal according to the pattern


provided by another signal is
ans:modulation

75) The octal equivalant of hexa number 123 is


ans:443
.Determine how many times the given loop

76) An 8kb computer will bave addresses -----


ans:8191

Automata:
1.what m/c is used to recognize context free grammar ? Ans. pushdown automata
2. Which type of grammar can be recognized by finite state m/c Ans. right linear
grammar.
3)What is a finite Automata.
4)what is a turing machine.

Network
1.In OSI, terminal emulation is done in (HCL)
a)semion b)appl.. c)presenta... d)transport
ans: b

2)Which are the different network toplogies ?

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


3) Tell an example of bus type network.
ethernet.

4)What is the Bandwidth of ethernet ?

5)Explain the advantage and disadvantage of ethernet ?

6)Which is the protocol used in ethernet. (CSMA/CD)


bridges, routers and generators

7)What is the advantage of Ring network ?


Compare it with ethernet.

8) Piggy backing is a technique for


a) Flow control b) sequence c) Acknowledgement d) retransmition
ans: c piggy backing
hughes
9 16 bit mantissa and 8 bit exponent can present what maximum value?
10 4bit window size in sliding window protocol, how many acknowledements can be
held?
CSMA/Cd protocol used in
Ans

11 Checksum in IP packet is
Sum of the bits and 9's complement of sum

12) TCP/IP hdr checksum : what method is used ?


Ans. one's complement of sum of one's complement (CRC)

13) CSMA/Cd is used in which lan Ans. Ethernet

14) One question on synchronous transmission :


ans. Timing info is embedded in data itself
ATM : Asynchronous transfer mode
telephone : Synchronous transfer

15) 4bit seq no in sliding window protocol with selective repeat.


what is the max no. of acks that can be held at transmitter
ans. 8

16) CSMA/CD is used in


a) token ring
b) FDDI
d) ethernet
Ans : d

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


17) Max no of Acknowledgements for a 4 bit sequence number in a
sliding window protocol.

18) ARP
a) MAC to IP
b) IP to MAC
c)
Ans : b

19) NSF

20) If A sends a message to B with encryption then key is


a)A public key
b)B public key
c)A private key
d)B private key
ans:b

21) if even parity is used for parity generation, what is the


hamming distance

22) the code set is {00000,00111,11100,11011}


what is the error detecting and correcting capability?
ans:2,1

23) IEEE 802.5 is


ans: TOKEN RING

24) bit stuffing used in HDLC Protocol for

25) which is not suitable to find out IP address


ans:ARP

26) IP AND IPX

27) execution phase can be


a. pipelined
b. no parallelism is possible
c. vector processing
d.

28)In public key algorithm , A wants to send message to B .....


which key is used
a. A public key
b. A private key

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c. B public key
d. B private key

29) to prevent replay attacks in transmission


a. symmetric encoding
b. Asymmetric encoding
c. for every exchange, key should be changed

30) flow control is used for


a. congestion at receiver
b.
c.
d.

31)If you type in the command


nohup sort employees > list 2 > error out &
and log off ,the next time you log in . the output
will be
a). in a file called list and the error will de typed in
a file error out
b). there will be no file called list or error out
c). error will be logged in a file called list and o/p
will be in error out
d). you will not be allowed to log in
e). none of the above

32) 202.141.65.62 type of IP address belong to which class. Ans:class B

33)What are the funs. of transport layer? What is TCP, UDP, their
differences .....

34) About ARP and RARP.

BFL

35) FTP(transfer a file b/w stations with user authentification)

37)TCP in transport layer (connection oriented)


38)gateway is used (to connect incompatible networks)

39) routers used (in network layer )

40) packets are formed ( in network layer )

41)fork in unix (system call used to create process)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


42)make (creation of more than one file )

43)in unix .profile contains ( start up program)

44)in unix echo is used for ( answer C)

44) In unix 'ls 'stores contents in( inode block)

45) 1.which is not used for error correction :


ANS :bit stuffing.

46)which of the following is not fctn of datalink layer:


ANS : Encryption.

47)voltage levels of rs232c:


ANS :+12,-12.

48) which of the following is not used for client/server.


i)RPC,ii)TCP/IP,iii)MESSAGEQs,iv)None
ANS: none.

49) 2) What is ATM


a)Automated teller machine
b) all time money
* c) Asynchronous ttransfer mode
d) Acttive test moniter

50) FDDI is a
* a) ring network
b) star network
c) mesh network
d) bus based network

51) x.25 transfer protocal is used for


a) packet switching
* b) circuit switching
c) framing
d) datagram
52) a t-switch is used to
a) control how message are passed between computers
b) echo every character that received
* c) transmit characers one at a time
d) rearrange the ....

53) 16)which network protocol IBM mainframe and midrange support


* a. SNA

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


b. TCP/IP
C. X.25
d.IEEE 802.5

54)the achronym DAN stands for


a.data acess nettwork
* b.distributed area network
c.desktop area network
d.disk access node

55) the fctn of datalink layer is:bit stuffing.

56)which of the following is not fctn of datalink layer: Encription.

57)voltage levels of rs232x:+12,-12.

58)which of the following is not used for client/server.

59)RPC,TCP/IP,MESSAGEQs None ans:may be none.

60) RS 232 is standards for


ans:physical layer

61) .25 protocol encapsulates the follwing layers


a)network
b)datalink
c)physical
d)all of the above
e)none of the above

62)TCP/IP can work on


a)ethernet
b)tokenring
c)a&b
d)none

63)x.25 protocol encapsulates the follwing layers


a)network
b)datalink
c)physical
d)all of the above
e)none of the above

64)TCP/IP can work on


a)ethernet
b)tokenring

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


c)a&b
d)none

65)a node has the ip address 138.50.10.7 and 138.50.10.9.But it is


transmitting data from node1 to node2only. The reason may be
a)a node cannot have more than one address
b)class A should have second octet different
c)classB " " " " "
d)a,b,c

66) the OSI layer from bottom to top

Software Engineering
HONEYWELL

1.WHat is software life cycle ?


2.How much time is spent usually in each phases and why ?
3.What is testing ?
4.Which are the different types of testing ?
5.What is the difference between RISC and CISC processors ?
6.Difference between loosely coupled and tightly coupled systems ?
7.What is an open system ?
8.Which are the different phases in Software life cycle (asked again)
9.Why is analysis and testing phases very important ?
path testing is
a. white box
b. black box
c. installation test
d. environment test

Reasoning
1) m has double amount as d, y has rs. 3 more than half of amount of d
the ordering a,b,c mcdcy
ans:data insufficient d c m c y

2)in stastic men cause more accidents then one conclusion


(a) men drive more than once
(b) stastics give wrong information
(c) women are caution than me ans; c(verify)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(d)-----etc

3) p,q,r,s,t,u -securing grant;two tourist parties and then two security gaurds should go
with each party
p and r-are enemies, q does not go south
p&s-are willing to be together

4) if a car starts from a towards b with some velocity due to some problem in the engine
after travelling 30km.if the car goes with 4/5 th of its actuval velocity the car reaches b
45min later to the actual time. If the car engine fails ofter travelling 45km, the car
reaches the destination b 36min late to the actual time , what is the initial velocity of car
and what is the distance between a and b in km
Ans) 20 & 130.

5)the values of shares a,b and c from january to june are as follows.

Month a b c
Jan 30 60 80
Feb 35 65 85
Mar 45 75 65
Apr 40 75 82
May 55 75 85
June 50 75 80

I) during this period which share has undergone max fluctuation?

Ii) in which month it is possible to buy b and c selling a?

Iii) in which month the share values are very low?

Iv) by purchasing one share of a and 4 each of b and c in the beginning of


The period , to get max profit when this shares should be sold?
V) ?

6. In a computer institute 9 languages can taught. The module is of 6


Months duration and only six languages each of one month can be taught.
In addition to that basic is always there and should be in first month
Itself
# word perfect is to be taught in the preceeding week of word star.
# fortran can not be taught until cobal is coarsed prior to that
# bino, fifo never be taught in single module
languages are basic, word star, word perfect, fortran, cobal, bino,
Fifo, lotus, c

I. Of the following which module is possible based on above conditions.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


Ii) if word star is in 3rd month , what could be in 6th month.

Iii) if cobal is in the 2nd month and bino in 6th month are there in
Addition to the above condition, fortran will be in which month.

7. In a class , except 18 all are above 50 years. 15 are below 50 years of


Age. How many people are there
a) 30 b) 33 c) 36 d) none of these.

8. A square plot of some size , at four corners equal squares of some size
Are cut and is formed as open box. If this open box carries 128ml of oil.
What is the size of the plate i.e. Side
A.17 b.14 c.13

9. In a square , all the mid points are joined. The inner square is
Shaded. If the area of the square is a, what is the shaded area?

10. Two questions on basic angles i.e given a circle, a few chords or
Diameter is drawn etc.

11. @(a,b)= (a+b)/2


/(a,b)= a.b
*(a,b)= ab , if a=1, b=2 find
i) /(a,(@(a,b),*(a,b)))

ii)

12. (x#y) = x+y-xy


(x*y) = (x+y)/2

i) (x#y)#(x*y) < (x#y), which of the below values of x, y will satisfy


This equation

Ii) (a*b)#(b*c)< (a#b)*(b*c) , what values of a,b,c satisfy the above.

13. By using the data given below answer the following questions.

b.tech m.sc m.a

Male 20
Female 80

Total 60
some thing similar to that question.

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


i) 40% of females are b.techs
ii) half of the students are either from b.techs of m.scs
iii) ...
I. What is the no. Of female b.techs
Ii....

14)l:says all of my other 4 friends have money


M:says that p said that exact one has money
N:says that l said that precisely two have money
O:says that m said that 3 of others have money.
P:land n said that they have money.
All are liers.who has money&who doesn't have?

15)a hotel has two,the east wing and the west wing.some east wing rooms
But not all have an ocean view(ov).all ww have a harbour view(hv).the
Charge for all rooms is identical, except as follows
* extra charge for all hv rooms on or above the 3rd floor
* extra charge for all ov rooms except those without balcony
* extra charge for some hv rooms on the first two floor&some ew rooms
Without ov but having kitchen facilities. (gre modrl test 3-question
1j-22)

16)post man has a data of name surname door no.pet name of 4 families.
But only one is correct for each family.there are a set of statements
&questions.

17)4 couples have a party.depending on the set of statements,find who


Insulted whom and who is the host of the party.

18)5 women given some of their heights(tall,medium,short)hair( long,


Plainted),stards(black or brown), sari,2 medium,2-short.tall->no
Sari.plainted->medium.answer the combinations.
1) a person has to go both northwards&southwards in search of a job.
He decides to go by the first train he encounters.there are trains for
Every 15 min both southwards and northwards.first train towards south
Is at 6:00 a.m. and that towards north is at 6:10 .if the person arrives
At any random time,what is the probability that he gets into a train
Towards north.

19) a person has his own coach&whenever he goes to railway station he


Takes his coach.one day he was supposed to reach the railway station
At 5 o'clock.but he finished his work early and reached at 3 o'clock.
Then he rung up his residence and asked to send the coach immediately.
He came to know that the coach has left just now to tje railway station.
He thought that the coach has left just now to the railway station.he

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


Thought that he should not waste his time and started moving towards
His residence at the speed of 3mi/hr.on the way,he gets the coach and
Reaches home at 6 o'clock.how far is his residence from railway
Station.

20)radha,geeta&revathi went for a picnic.after a few days they forgot the


Date,day and month on which they went to picnic.radha said that it was
Onthursday,may 8 and geeta said that it was thursday may 10.revathi
Said friday jun 8.now one of them told all things wrongly,others one
Thing wrong and the last two things wrongly.if april 1st is tuesday
What is the right day,date and month?

lucent

21) q is not equal to zero and k = (q x n - s)/2 find n?


(a) (2 x k + s)/q (b) (2 x s x k)/q (c) (2 x k - s)/q
(d) (2 x k + s x q)/q (e) (k + s)/q

(from gre book page no:411)


data:
a causes b or c, but not both
f occurs only if b occurs
d occurs if b or c occurs
e occurs only if c occurs
j occurs only if e or f occurs
d causes g,h or both
h occurs if e occurs
g occurs if f occurs

Note: check following answers.

22) if a occurs which of the following must occurs

i. F &amp; g
ii. E and h
iii. D

(a) i only (b) ii only (c) iii only (d) i,ii, &amp; iii
(e) i &amp; ii (or) ii &amp; iii but not both ans: (e)

23) if b occurs which must occur


(a) d (b) d and g (c) g and h (d) f and g (e) j ans: (a)

24) if j occurs which must have occured


(a) e (b) either b or c (c) both e &amp; f (d) b (e) both b &amp; c ans: (b)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


25) which may occurs as a result of cause not mentioned
(1) d (2) a (3) f
(a) 1 only (b) 2 only (c) 1 &amp; 2 (d) 2 &amp; 3 (e) 1,2,3 ans: (c)

26) e occurs which one cannot occurs


(a) a (b) f (c) d (d) c (e) j ans: (b)
11 to 15:- ----------- e , a , b , c , b ---------------

27) there r 3 boys 7 4 girls; howmany ways they r arranged


such that boys should be always together ???

(ans: 240

28) if n.....; What is the max no that divides

(ans: 8)

29) a,b,c,d has values from 0 to 9.... What is d ?

(ans: 6)

30) a wodden piece taken which is in shape of triangle ,


of 10 x 24 x 26 ; then cut at some ..... Which is rearranged
in rectangle format; so what is ...

(ans: 5)

31) there r 5 numbers. The average is 25; the highest value


excluded then average is 25, if the lowest is excluded the avg is ..
then average of remaining is ?

(ans: 30)

32) the square is cut such that the end point of one side is
shown in fig.. This is repeated two times, what is the area ??

(ans: 3.61)

33) the route problem... What is the shortest rout to p1 to p2...


(there may be circle figure......)

(ans: from p1 to 0 & form 0 to p8)

34) two motor cycles a & b are started from one point at
4 kmph & 6 kmph; after 45 min b starts returning , at what
time they will reach....

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(ans: 3.6 km)

35) all integer from 0 to 9, what is the smallest no perfectly devides;

(ans: c)

Kya kya is an island in the south pacifi . The inhabitants of kya kya
Always answer any question with two sentences, one or which is always
True and other is always false.

36) you are walking on the road and come to a fork. You ask ,the inhabitants
Ram.laxman, and lila as" which road will take me to the vilage?

Ram says: i never speak to strangers. Iam new to this place


Laxman says: iam married to.lila. Take the left road
Lila says: iam married to ram. He is not new to this place

Ans: left road take yu to the village

37) you find that your boat is stollen. U questioned three inhabitants ot islands and their
replies are

John : i didnot do it. Mathew didnot do it


Mathew : i didnot do it. Krishna didnot do it
Krishna: i did not do it; i donot know who did it

Ans: mathew stolen the boat

38) you want to speak to the chief of village , u ask three fellows amar
Bobby, charles and bobby is wearing red shirt

Amar : iam not bobby`s son ; the chief wears red shirt
Bobby : iam amars father ; charles is the chief
Charles : the chief is one among us; iam the chief

Ans: bobby is the chief

39) there is only opne polot in the village(island). You interviewed threem man
Koisk ,lorry and mishra
U also notice that koisk is wearing cap.

M says : larry is father in the pilot .larry is not the priests son
Koisk : iam the priest on theis island only prists can wear the caps
Larry : iam the priest son . Koisk is not the prest

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


Ans : koisk is the pilot

Numeric Ability
1.given 100 to 999 nos. Probability of picking a no. with out
digit 7. Ans. 18/25.

2. Ten film rolls. 3 defective, prob. of picking up 2 defective


rolls with out replacement Ans. 6/90

3. The purpose of hashing is :


Ans. O(1) complexity
IBM

4. In 1978, a kg of paper was sold at Rs25/-. I f the paper rate increases


at 1.5% more than inflation rate which is of 6.5% a year , then what wil
be the cost of a kg of paper after 2 years?
a)29.12 (b) 29.72 (c) 30.12 (d) 32.65 (e) none of these

5. In A,B,C are having some marbles with each of them. A has giben B and C the same
number of marbles they already have to each of them. then, B gave C and A the same no.
of marbles they have, then C gave A and B the same no. of marbles they have. At the
end A,B,and C have equal no. of marbles.
(i) If x,y,z are the marbles initially with A,B,C respectively.
then the no of marbles B have at the end
(a) 2(x-y-z) (b) 4(x-y-z) etc.

(ii)If the total no. of marbles are 72, then the no. of marbles
with A at the starting
a. 20 b. 30 c. 32
6) person has Rs 100/- in his pocket, he can as 25 pencils or 15books.
He kept 15% of the money for travelling expenses and purchased 5
ncils.So how many books he can purchase with the remaining money.
A boy multiplied a number with 10 and got 100,insted of
dividing it . If he devided it what would be the answer?
(Ans is 1)

7)If 12 shell cup board requires 18ft of wall space then


30 " " " " how much wall space?
(Ans is 45)

8)The average salary of three employee is 95Rs.per week.


If one employee earns 115 and other earns 65 rupees.
how much will third be earn?
(Ans is 105Rs)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


9)A company instaled 36 punching machines at the begining of
the year.In the spring they instaled 9 additional m/c's
and then discontinued 18 in the fall.How many were still
installed at the end of the year?
(Ans is 9)check

10)During a given week a programmer spend 1/4 of his time


preparing charts,3/8 of his time for coding,rest of his time
for debugging the programs.If he had 48 hrs during the week
how many hours did he spend debugging the program.
(Ans is 18hrs)

11)A 16 story building has 12000ft on each floor. Company A


rents 7 floors and company B rents 4 floors. What is the
number of square feet of unrented floor space?
(Ans is 60000 sqft)

12)A man owns 2/3 of a computer service buroue business and


sells 3/4 of his share for $75000.What is the value of the
business.
(Ans is 150,000)

13)A computer printer produces 176400 lines in a given day.


If the printer was in operation for 7hrs during the day
how many lines did it print per minute?
(Ans is 420)

14)From its total income a company spent $20000 for advertising


half of the remainder on salaries and had $6000 left.What
was the total income?
(Ans is $32000)

15)In a certain company 20% of the men and 40% of the women
attended the annual company picnic.If 35% of all the emplo-
yees are men .What % of all the employee went to the picnic?
(Ans is 33%)

16)The dimensions of certain IBM m/c are 48"*30". If the


size of the m/c is increased proportionally until the
sum of its dimensions equals to 156".What will be the
increase in the shortest side?
(Ans is 30)

17)If a card punch operator can process 80 cards in half an hour


How many cards can this process in 7hr30min?

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


(Ans is 1200)

18)In a computer tape library there are two racks with 40 tapes
per rack.In a given day 30 tapes are in use . What fraction
remains in the rack?
(Ans is 5/8)

19)In 1978, a kg of paper was sold at Rs25/-. I f the paper rate increases at 1.5% more
than inflation rate which is of 6.5% a year , then what wil be the cost of a kg of paper
after 2 years?
a)29.12 (b) 29.72 (c) 30.12 (d) 32.65 (e) none of these

20)In A,B,C are having some marbles with each of them. A has giben B and C the same
number of marbles they already have to each of them. then, B gave C and A the same no.
of marbles they have, then C gave A and B the same no. of marbles they have. At the end
A,B,and C have equal no. of marbles.
(i) If x,y,z are the marbles initially with A,B,C respectively.
then the no of marbles B have at the end
(a) 2(x-y-z) (b) 4(x-y-z) etc.
(ii)If the total no. of marbles are 72, then the no. of marbles
with A at the starting
a. 20 b. 30 c. 32

21)If a car starts from A towards B with some velocity due to some problem in the engine
after travelling 30km.If the car goes with 4/5 th of its actuval velocity the car reaches B
45min later to the actual time. If the car engine fails ofter travelling 45km, the car reaches
the destination B 36min late to the actual time , what is the initial velocity of car and
what is the distance between A and B in km
ans) 20 & 130.

22)A person has Rs 100/- in his pocket, he can as 25 pencils or 15books.He kept 15% of
the money for travelling expenses and purchased 5 PEncils.So how many books he can
purchase with the remaining money.

23) ten questions on analogies.


ex: hammer : carpenter ::
knife : butcher.

23) The values of shares A,B and C from january to june are as follows.

month A B C

JAN 30 60 80
FEB 35 65 85
MAR 45 75 65
APR 40 75 82

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


MAY 55 75 85
JUNE 50 75 80

i) During this period which share has undergone max fluctuation?


ii) In which month it is possible to buy B and C selling A?
iii) In which month the share values are very low?
iv) By purchasing one share of A and 4 each of B and C in the beginning of the period ,
to get max profit when this shares should be sold?

24) In a computer institute 9 languages can taught. The module is of 6


months duration and only six languages each of one month can be taught. In addition to
that BASIC is always there and should be in first month itself
# word perfect is to be taught in the preceeding week of word star.
# FORTRAN can not be taught until COBAL is coarsed prior to that
# BINO, FIFO never be taught in single module
languages are BASIC, WORD STAR, WORD PERFECT, FORTRAN, COBAL, BINO,
FIFO, LOTUS, C
i. Of the following which module is possible based on above conditions.
ii) If word star is in 3rd month , what could be in 6th month.
iii) If COBAL is in the 2nd month and BINO in 6th month are there in
addition to the above condition, FORTRAN will be in which month.

25)In a class , except 18 all are above 50 years. 15 are below 50 years ofage. how many
people are there
a) 30 b) 33 c) 36 d) none of these.

26)A square plot of some size , at four corners equal squares of some size are cut and is
formed as open box. If this open box carries 128ml of oil.

27)What is the size of the plate i.e. side


a.17 b.14 c.13

28) In a square , all the mid points are joined. the inner square is
shaded. If the area of the square is A, what is the shaded area?

29)11. two questions on basic angles i.e given a circle, a few chords or diameter is drawn
etc.

30) @(a,b)= (a+b)/


/(a,b)= a.b
*(a,b)= ab , if a=1, b=2 find
i) /(a,(@(a,b),*(a,b)))

31) A boy multiplied a number with 10 and got 100,insted of


dividing it . If he devided it what would be the answer?
(Ans is 1)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


32)If 12 shell cup board requires 18ft of wall space then
30 " " " " how much wall space?
(Ans is 45)
33)The average salary of three employee is 95Rs.per week.
If one employee earns 115 and other earns 65 rupees.
how much will third be earn?
(Ans is 105Rs)

34)A company instaled 36 punching machines at the begining of


the year.In the spring they instaled 9 additional m/c's
and then discontinued 18 in the fall.How many were still
installed at the end of the year?
(Ans is 9)check

35)During a given week a programmer spend 1/4 of his time


preparing charts,3/8 of his time for coding,rest of his time
for debugging the programs.If he had 48 hrs during the week
how many hours did he spend debugging the program.
(Ans is 18hrs)

36)A 16 story building has 12000ft on each floor. Company A


rents 7 floors and company B rents 4 floors. What is the
number of square feet of unrented floor space?
(Ans is 60000 sqft)

37)A man owns 2/3 of a computer service buroue business and


sells 3/4 of his share for $75000.What is the value of the
business.
(Ans is 150,000)

38)A computer printer produces 176400 lines in a given day.


If the printer was in operation for 7hrs during the day
how many lines did it print per minute?
(Ans is 420)

39)From its total income a company spent $20000 for advertising


half of the remainder on salaries and had $6000 left.What
was the total income?
(Ans is $32000)

40)In a certain company 20% of the men and 40% of the women
attended the annual company picnic.If 35% of all the emplo-
yees are men .What % of all the employee went to the picnic?
(Ans is 33%)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


41)The dimensions of certain IBM m/c are 48"*30". If the
size of the m/c is increased proportionally until the
sum of its dimensions equals to 156".What will be the
increase in the shortest side?
(Ans is 30)

42)If a card punch operator can process 80 cards in half an hour


How many cards can this process in 7hr30min?
(Ans is 1200)

43)In a computer tape library there are two racks with 40 tapes
per rack.In a given day 30 tapes are in use . What fraction
remains in the rack?
(Ans is 5/8)

44) 1) There are two balls touching each other circumferencically.


The radius of the big ball is 4 times the diameter of the small
ball.The outer small ball rotates in anticlockwise direction
circumferencically over the bigger one at the rate of 16 rev/sec.
The bigger wheel also rotates anticlockwise at Nrev/sec. what is
'N' for the horizontal line from the centre of small wheel always
is horizontal.

45) 1 2 3 4
+3455
----------
4689
-2345
----------
2344
+1254
------------
3698
Q) Strike off any digit from each number in seven rows (need not
be at same place) and combine the same operations with 3 digit numbers
to get the same addition. After this strike off another digit from all
and add all the No.s to get the same 2 digit No. perform the same
process again with 1 digit No.s. Give the ' no.s in 7 rows at
each stage.

46) there is a safe with a 5 digit No. The 4th digit is 4 greater than
second digit, while 3rd digit is 3 less than 2nd digit. The 1st digit
is thrice the last digit. There are 3 pairs whose sum is 11. Find
the number. Ans) 65292.

47) there are 2 guards Bal and Pal walking on the side of a wall of a

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


wearhouse(12m X 11m) in opposite directions. They meet at a point and
Bal says to Pal " See you again in the other side". After a few moments
of walking Bal decides to go back for a smoke but he changes his
direction again to his previous one after 10 minutes of walking in
the other(opposite) direction remembering that Pal will be waiting
for to meet.If Bal and Pal walk 8 and 11 feet respectively, how
much distance they would have travelled before meeting again.

48) xxx)xxxxx(xxx
3xx
-------
xxx
x3x
------
xxx
3xx
------
Q) Find the 5 digit No.
Hint: 5 is used atleast once in the calculation.

49) Afly is there 1 feet below the ceiling right across a wall length
is 30m at equal distance from both the ends. There is a spider 1 feet
above floor right across the long wall eqidistant from both the ends.
If the width of the room is 12m and 12m, what distance is to be
travelled by the spider to catch the fly? if it takes the shortest
path.

50) Ramesh sit around a round table with some other men. He has one
rupee more than his right person and this person in turn has 1 rupee
more than the person to his right and so on, Ramesh decided to give
1 rupee to his right & he in turn 2 rupees to his right and 3 rupees
to his right & so on. This process went on till a person has
'no money' to give to his right. At this time he has 4 times the
money to his right person. How many men are there along with Ramesh
and what is the money with poorest fellow.

51)Question related to probabilities of removing the red ball from a


basket,given that two balls are removed from the basket and the other
ball is red. The basket contains blue,red,yellow balls.

52)Venkat has 1boy&2daughters.The product of these children age is 72.


The sum of their ages give the door numberof Venkat.Boy is elder of
three.Can you tell the ages of all the three.

53) A SOLID ICE OF 11 X 8 X2 INCHES IS MADE INTO ROD OF DIA 4 INCH.


WHAT

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


IS THE LENGE OF ROD?
ANS: 3.5 INCH

54) THERE WERE 750 PEOPLE WHEN THE FIRST SONG WAS SUNG. AFTER
EACH
SONG 50 PEOPLE ARE LEAVING THE HALL. HOWMANY SONGS ARE SUNG
TO MAKE
THEM ZERO?

ANS:16

55) A PERSON IS CLIMBING OF 60 MTS . FOR EVERY MINUTE HE IS


CLIMBING 6 MTS
AND SLIPPING 4 MTS . AFTER HOWMANY MINUTES HE MAY REACH THE
TOP?

ANS: (60-6)/2 +1 :28

56) HOWMANY ZEROS ARE THERE IN THE PRODUCT OF THE INTEGER FROM
1TO 100?

ANS: 24( NOT GIVEN)

1 TO 10 -2 ZEROS
21 TO 30 -3 ZEROS : BECAUSE 25 = 5*5
22 *5
24 *5

57) A CAN DO WORK IN 2 HOURS B CAN DO A WORK IN 3 HOURS WHAT IS


THE
SHORTEST TIME TYEY CAN FINISH THE WORK?

ANS: 1HOUR 12 MIN.

58)SALARY IS INCREASED BY 1200 ,TAX IS DECREASED FROM 12% TO 10%


BUT PAYING
SAME AMOUNT AS TAX . WHAT IS THE PREVISIOUS SALARY?

ANS:6000

59) THE LEAST NO. WHICH IS WHEN DEVIDED BY 4,6,7 LEAVES A


REMAINDER OF 2 ?

ANS: 86

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


60)A MAN DRIVING THE CAR AT TWICE THE SPEED OF AUTO ONEDAY HE
WAS DRIVEN
CAR FOR 10 MIN. AND CAR IS FAILED. HE LEFT THE CAR AND TOOK AUTO
TO GOTO
THE OFFICE . HE SPENT 30 MIN. IN THE AUTO. WHAT WILL BE THE TIME
TAKE BY
CAR TO GO OFFICE?

ANS:25 MIN

61) A REPORT HS 20 WHEETS, EACH OF 55 LINES AND EACH SU;CH A LINE


CONSISTS
OF 65 CHARACTERS. IF THE REPORT HAS TO BE RETYPED WITH EACH
SHEET HAVING 65
LINES AND EACH LINE HAVE 75 CHARACTERS, THE PERCENTAGE OF
REDUCTION OF
NO OF SHEETS IS CLOSEST IS TO?

ANS: 25%

62) OUT OF 100 FAMILIES IN NEIGHBOUR HOOD , 55 OWN RADIO, 75 OWN


T.V
AND 25 OWN VCR. ONLY 10 FAMILIES HAVE ALLOF THESE, AND EACH VCR
OWNER
HAS TV . IF 25 FAMILIES HAVE THE RADIO ONLY, THE NO. OF FAMILIES
HAVE
ONLY TV ARE?

ANS: 30

63) ONE RECTANGULAR PLATE WITH LENGTH 8INCHES,BREADTH 11


INCHES AND
2 INCHES THICKNESS IS THERE.WHAT IS THE LENGTH OF THE CIRCULAR
ROD
WITH DIAMETER 8 INCHES AND EQUAL TO VOLUME OF RECTANGULAR
PLATE?
ANS: 3.5INCHES
64) WHAT IS THE NUMBER OF ZEROS AT THE END OF THE PRODUCT OF THE
NUMBERS
FROM 1 TO 100

65) in some game 139 members have participated every time one fellow will
get bye what is the number of matches to choose the champion to be
held?

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


ans: 138

66) one fast typist type some matter in 2hr and


another slow typist type the
same matter in 3hr. if both do combinely in how much time they
will finish.
ans: 1hr 12min

67) in 8*8 chess board what is the total number of squares


refer odel
ans:204

68) falling height is proportional to square of the time.


one object falls 64cm in 2sec than in 6sec from how much
height the object will fall.

69) gavaskar average in first 50 innings was 50 . after the 51st


innings his average was 51 how many runs he made in the 51st
innings

70) 2 oranges,3 bananas and 4 apples cost Rs.15 . 3 ornages 2 bananas


1 apple costs Rs 10. what is the cost of 3 oranges, 3 bananas and
3 apples ANs Rs 15.

71) in 80 coins one coin is counterfiet what is minimum number of


weighings to find out counterfiet coin

72)in a company 30% are supervisors and 40% employees are male
if 60% of supervisors are male. what is the probability
that a randomly choosen employee is a male or female?

73)statement: all green are blue are blue, all blue are white
conclusion:
I) some blue are green II) some white are green
III)some green are not white IV) all white are blue
a) he has given four choices like gre type

74)all teachers are students. some students are girls.


this type of questions are there.
we cant able to reproduce them.:wq

APTITUDE TEST
75)33 1/3 of 101 + 296 is
(ans 1200) check

76)0.625= ? (ans 27/40)

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


77)One ship goes along the stream direction 28 km and in opposite
direction 13 km in 5 hrs for each direction.What is the velocity
of stream?
(ans 1.5 kmph)

78)Cubic root of 3375=?


(ans 15)

79)2020201-565656=?
(ans 1454545)

80)CHAIRS PROBLEM
5 chairs=9 tables,12 tables = 7 stools likethat- - -
(ans is 80Rs)

81)One clock ringes 7 O'clock in 7 sec.In how many seconds it will


ring 10 O'clock.
(ans 10.5 sec)

82)One watch is showing 30 past 3 .What is the angle between minutes &
hours hand?
(ans 75 degrees)

83)The average of 4 consecutive even numbers is 27. What is the largest


number?
(ans 30)

84) 25 stations ,24 stations are inbetween- - - - -


how many tickets should be required.
(ans 25*24=600)PUZZLES TO PUZZLE YOU "S.DEVI"PROB 24

85)One ball was dropped from 8ft height and every time it goes half
of the height. How much distance it will travell before coming to
rest.
(ans 24 approximately)

86)Two trains are travelline at equilateral .Train A is travelling


in the direction of earths spin.Other train B is travelling in
opposite direction of earths spin.Which trains wheels will wear
first?and why?
(ans TRAIN B .Because of less centrifugal force.)

87).6*12*15 is the volume of some material.How many cubes can be inserted into that?
Ans.40

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


88)Two pipes can fill a tank in 10 1nd 12 hours while third pipe will make the tank
empty in 20 hours.If all three pipes operate simultaneously,in how many hours the
tank will be filled ?
Ans.7hours 30 minutes.

89)Diameter of a beaker is 7cm. Mambler(some instrument)dia is 1.4cm.How many


mamblers
has to be put to increase the water level by 5.6cm.

90)Cost of an item is x. It's value increases by p% and decreases by p%Now the new
value
is 1 rupee, what is the actual value.
Ans.(1000)/(1000-p*p).

91)A right circular cylinder and a cone are there.Base radius of cone is equal to radius
of cylinder.What is the ratio of height to slant side.

92)Distance between two poles is 50 meters.A train goes by 48 kmph in one minute.How
many
poles will be crossed by the train.

93)A pole seen from a certain distance at an angle of 15 degrees and 100 meters ahead by
30 degrees. What is th height of pole.

94)15 people--each has to pay Rs.20.. 20 people--each has to pay Rs.18.. for 40 people--
how
much has to pay ?

95)if p=2q then q=r*r,if p-odd then q is even,whether we decide r is even or odd ?
choices:a)first condition is sufficient
b)second condition is sufficient
c)both are sufficient
d)both are not sufficient

96)What is the value of m given that


i) m is devided by 2
ii) m is devided by 5
Ans: none of these

97)If he sells 40 magoes, he will get the selling price of 4 mangoes extra, What is his %
increse in profit ?

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


Ans: 25%

98)100 glasses are there. A servant has to supply glasses to a person If he supplies the
glasses without any damage he will et 3 paise otherwise he will loose 3 paise.At the
end of supplying 100 glasses if he gets 270 paise, how many glasses were supplied
safely.
Ans: 95

99) distance D=rt where r & t are +ve and r is constant,as t increses then
D_________

ans:D increses irrespective of r & t

100)E=I*I*R what is the effect of E when I becomes I/2


ans:1/4E(E decreses by 4 times)

101) out of 55 eggs 5 are defective. what is % of defective eggs


ans:9/11%

102)salary is 's' per month,'x'% of salary is given as bonus, if 3 months


salary is s1,s2 & s3 then what is his salary.
ans:s1*x/100 + s2*x/100 + s3*x/100

103)consider expresion 'ab' . what happens when 'a' is divided by 'c' &
'b' is
multiplied by 'c'.
ans:value remains same.

104) area of triangle=1/2*b*h base incresed by 4 times & height is devided


by
2, the net effect of area.
ans:twice the the original area.

105) in base representation for a rupee 100 paise,then base 8


representation
what is rupee value .

ans:144

106) A>B,B>C,C=D,D>E,then which is greatest


a)A/B b) A/C c) A/E d)none

ans: c

107)to travel 'm' miles the time is 'h' hours,then what is the time taken
to

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html


travel M miles.

ans:M*h/m

108) a sum 's' is devided into 4 parts.second person gets Rs 10 more than
first.3rd person is Rs 10 more than second, 4th is 10 more than 3rd.
how much amount do 1st person get.

ans;(s-60)/4

109) fridge cost R Rs,cover value is 5,discount d% then its new cost

ans:R-R*d/100-5(1-d/100)

110)1/8 is devided by 's' , if 's' is incresed by 2 times, what is the


result.

ans:increses two times.


section 2. letter series
-------------------------
1. a c b d f e g i __ ans: h
2. x y z u v w r s t __ ans: o
3. a c f j o __ ans:u
section 3. numerical ability
-------------------------------
1. 10099+99=10198
2. 31 - 29+2/33=__ ans:64/33
3. 2.904+0.0006=___ ans: 2.9046
4. 55/1000=___ ans:.005
5. 0.799*0.254= 0.202946
6. 200/7*5.04=144
7. 842.8 +602=1444.8
8. 5.72% of 418= 23.9096
9. 625% of 7.71=48.1875
10. 25% of 592=148.00
11. 665+22.9=687.9
12. 15% of 86.04=12.906

No license: PDF produced by PStill (c) F. Siegert - http://www.this.net/~frank/pstill.html