Computer Technical Questions
Computer Technical Questions
Computer Technical Questions
}
a)8 b)6 c)5 d)4 e)none
Answer : c)5
16. What is the output of the following program?
main()
{
int x=20;
int y=10;
swap(x,y);
printf("%d %d",y,x+2);
}
swap(int x,int y)
{
int temp;
temp =x;
x=y;
y=temp;
}
a)10,20 b) 20,12 c) 22,10 d)10,22 e)none
Answer:d)10,22
17. What is the output of the following problem ?
#define INC(X) X++
main()
{
int X=4;
printf("%d",INC(X++));
}
a)4 b)5 c)6 d)compilation error e) runtime error
Answer : d) compilation error
18. what can be said of the following
struct Node {
char *word;
int count;
struct Node left;
struct Node right;
}
a) Incorrect definition
b) structures cannot refer to other structure
c) Structures can refer to themselves. Hence the statement is OK
d) Structures can refer to maximum of one other structure
Answer :c)
19. What is the size of the following union. Assume that the size of int =2, size of float =4
and size of
char =1.
Union Tag{
int a;
flaot b;
char c;
};
a)2 b)4 c)1 d) 7
20. What is the output of the following program? (. has been used to indicate a space)
main()
{
char s[]="Hello,.world";
printf(%15.10s",s);
}
a )Hello,.World...
b)....Hello,.Wor
c)Hello,.Wor....
d)None of the above
printf("%d",++(*p));
23.
main()
{
printf("%d ",var--);
if(var)
main();
}
What is the output?
(a) 1 2 3 4 5
(b) infinite loop
(c) 5 4 3 2 1
(d) compiler error
Ans :c
24.
main()
printf("\nab");
printf("\bsi");
printf("\rha");
(a) has
(b) hasaiaab
(c) hai
(d) aas
Ans :c
25.
#include
#define a 10
main()
#define a 50
printf("%d",a);
(a) 10
(b) 50
(c) error
(d) none
Ans:B
26. Minimum number of queues needed to implement the priority queue?
(a) one
(b) two
(c) three
(d) zero
Ans:B
27. What are the notations used in Evaluation of Arithmetic Expressions using prefix and
postfix forms?
(a) Reverse Polish notations
(b) Polish
(c) both
(d) none
Ans :C
29. Of the following tree structure, which is, efficient considering space and time
complexities?
(a) Incomplete Binary Tree
(b) Complete Binary Tree
(c) Full Binary Tree
(d) None
Ans:B
33. Which is the parameter that is added to every non-static member function when it is
called?
(a)‘this’ pointer
(b) ‘far’ pointer
(c)‘near’ pointer
(d) all
Ans:A
34. A collection of programs that enables user to create and maintain a database is called
(a) DBMS
(b) DB
(c) DBA
(d) All
Ans:A
36. When one of the data elements stored within a construct is utilized as the primary key,
then it is called
(a) Foreign key
(b) Natural key
(c) Primary key
(d) Alternate key
Ans:B
void main()
{
int i=7;
printf("%d",i++*i++);
}
main()
int i=0;
for(i=0;i<20;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
Ans:D
40. Find the output
main()
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
(a) 1 5 20
(b) 20 5 1
(c) 5 20 1
(d) 1 5 10
Ans:C
47. Buffering is
(a) the process of temporarily storing the data to allow for small variation
in device speeds
(b) a method to reduce cross talks
(c) storage of data within transmitting medium until the receiver is ready
to receive.
(d) a method to reduce routing overhead.
Ans: (a)