Professional Documents
Culture Documents
VB6 Interview Questions
VB6 Interview Questions
VB6 Interview Questions
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
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?
monitors, paging, swapping Ans. Monitors
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)
{
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....
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 "
"
"
multiple "
c)"
d)none
60widget in x-windows is
61)adget in x_windows is
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
(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
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
UNIX
1)The command ......ln/bin/mail /usr/you/bin/m
a)will not be executed because you are linking files
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
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
"
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)
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)
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;
x=j*k;
printf("%d", x);
ans x=1
3. fn f(x)
{ if(x<=0)
return;
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
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
b.
"
stack
"
address space
c.
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
prog2:
prog 1:
main()
{
int fact;
long int x;
fact=factoral(x);
}
main()
{
int fact=0
for(i=1;i<=n;i++)
fact=fact*i;
}
}
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)
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
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
(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
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
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];
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";
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=
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
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";
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)
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)
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() {
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;
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
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");
else
printf("statement 2");
}
/* statement 2 */
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 */
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 ?
*/
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 */
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);
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.
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)
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
{
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);
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);
167) int a[5],*p;
for(p=a;p<&a[5];p++)
{
(bitwise operators)
*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));
}
(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.
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)
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;
ans x=1
j=k=6;x=2;
x=j*k;
printf("%d", x);
212)
fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}
213)
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
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)==
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;
}
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)
{
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
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="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
236) what would the following program results in
main()
{
char p[]="string";
char t;
int i,j;
for(i=0,j=strlen(p);i<j;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
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>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)
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("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
239) 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
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="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
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;
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
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?
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
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;
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
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
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()
{
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
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.)
because
(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);
* c.perl
d. ada
308) FORTRAN implimentation do not permit recursion because
* a) they use static allocation for variables
b) "
dynamic "
"
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) "
b "
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) "
" run
" "
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
* 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 "calc(a,b)"and that "a"and
"b"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?
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);
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)
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()
{
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<18) do {m=m+2;m=m-1}
ans:15
344)m=1;a=30;while (m<>1) do {m=m+1;a=a-1;}
345)m=1;a=30;while (e*m-5<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<=4)do {a=a+b;x=x+1}
ans:(5,1)34*)
348)a=1;b=2;x=1 while (x<=5)do {b=a+b;x=x+1;}
ans:(1,6)
349)a=0;b=0;x=1;while (x<=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
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
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
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
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.
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 ?
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
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)
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
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)
(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
Jan
Feb
Mar
Apr
May
June
a
30
35
45
40
55
50
b
60
65
75
75
75
75
c
80
85
65
82
85
80
m.a
20
80
60
some thing similar to that question.
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 & g
ii. E and h
iii. D
(a) i only (b) ii only (c) iii only (d) i,ii, & iii
(e) i & ii (or) ii & 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 & f (d) b (e) both b & c ans: (b)
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)
(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
JAN
FEB
MAR
APR
30
35
45
40
60
65
75
75
80
85
65
82
MAY
JUNE
55
50
75
75
85
80
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%
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)
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 ?
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
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
ans:u
3. a c f j o __
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