1. Which of the following memories needs a refresh?
A. SRAM
B. ROM
C. DRAM
D. PROM
Ans: C
2. A _____________ is one end point of a two-way communication link between two programs running on the network
A. bridge
B. slot
C. socket
D. port
Ans: C
3. Which of the following light -sensitive devices converts drawing, printed text or other images into digital format
A. Printer
B. Scanner
C. Plotter
D. OMR
Ans: B
4.Whcih of the following 4bit codes is invalid BCD code?
A. 110
B. 0010
C. 0101
D. 1100
Ans: A
5. Which of the following is not a valid IP address?
A. 192.0.0.0
B. 192. 168.233.0
C. 255.255.255.255
D. 192.168.287.78
Ans: D
6. The 2's Complement form of the result of the subtraction -3 from 2 is:
A. 1010
B. 0101
C. 0001
D. 1101
Ans: B
7. What is the simplest way of implementing a graph in C or C++?
A. None
B. Associate lists
C. Adjacency matrix
D. Both Adjacent and Associate lists
Ans: B
8._______________ are the silicon chips used for data processing.
A. Microprocessor
B. RAM chips
C. PROM Chips
D.
Ans: A
9. The minimum number of queues needed to implement the priority queue is:
A. 4
B. 3
C. 1
D. 2
Ans: D
10. ________ method of HTTP is visible to everyone and has limits to send
A.GET
B.POST
C.PUT
D.TRACE
Ans: C
11. The minimum number of temporary variables needed to swap the contents of two variables is/are
A. 1
B. 2
C. Three
D. Zero
Ans: D
12. If L is the left node, M is the middle node and R is the right node of a binary tree, then an L-M-R traversal can be termed as
A. Pre-order Traversal
B. That is an invalid traversal order
C. In-order traversal
D. Post-order traversal
Ans: C
13. what will be the output of the following code?
#include<stdio.h>
int fun(int i)
{
return (i++);
}
int main( )
{
int i=fun(9);
printf("%d\n",--i);
return 0;
}
A.9
B. 10
C. 8
D. 7
Ans: C
14. The output of the following code is
char* myFun(Char *ptr)
{
ptr+=2;
return (ptr);
}
int main( )
{
char *a,*b;
a="PINKY";
b=myFun(a);
printf("b=%s \n",b);
return 0;
}
A. b=NKY
B. b=PI
C. b=KY
D. b=NK
Ans: A
15. What will be the output of the following code:
A. Yes
B. Compile time error
C. Runtime Error
D. No
Ans: D
16. What will be the output of the following code:
#include<stdio.h>
#define run(x,y) x*y
int main( void){
int a=3, b=4;
printf("%d",run(a+2,b-1);
return 0;
}
A. 10
B. 11
C. 12
D. 15
Ans: 10
run(x+2, y-1) = x+2*y-1 = 3+2*4-1 = 3+8-1=10
17. Which of the following is the best mode of connection between devices which need to send or receive large data over a short distance?
1. Serial port
2. Parallel port
3. Isochrnonous port
A. Only 2 and 3
B. Only 3
C. Only 2
D. Only 1 and 2
Ans: C
18. What will be the output of the following code?
#include<stdio.h>
#include<string.h>
int main( )
{
int i,n;
char *x="Source";
n=strlen(x);
*x=x[n];
for(i=0;i<n;++i)
{
printf("%s\n",x);
x++;
}
return 0;
}
A. Source
ource
urce
rce
ce
e
B. It will print " Source" 6 times
C. Source
D. Run time error
Ans: D
1. The function accepts integers 'direction', 'distance1', 'time1', 'distance2' and 'time2' as its arguments. 'distance1' and 'distance2' are the distances traveled and 'time1' & 'time2' are the time taken by 1st & 2nd person respectively Implement the function to find 'speed1' & 'speed2' of 1st & 2nd person respectively and return the relative speed as per given conditions.
int RelativeSpeed(int direction,int distance1,int time1,int distance2,int time2)
{
}
2.The function accepts an array 'arr' of 'n' integers as its arguments. The array 'arr' contains both odd and even integers. You are required to find the maximum between the sum of odd integers and sum of even integers in array 'arr' and return the same.
int MaximumOddEven(int arr[ ], int n)
{
}
3. An item is represented by the following structure
structure Item
{
int product_id;
int quantity;
int price;
};
The function accepts an array 'shoplist' of type 'item' consisting of 'm' products as its arguments. Implement the function to calculate the total bill and return the same. Total bill is calculated by adding total amount of each product.
4. The function accepts two integer arrays 'key' and 'paper' of length 'n' as its argument. 'key' contains the correct answers of examination and 'paper' contains the answers that a student has given, like {1,2,1,3}. Unanswered questions are denoted by -1. while scoring the examination, a correct answer gets +3 marks, an incorrect answer gets -1 marks and an unanswered question gets 0 marks. Implement the function to calculate and return the result of a MCQ examination by comparing given 'paper' and 'key' sequentially.
int MCQResult (int n, int key[ ], int paper[ ])
{
}
5. The function accepts two strings 'str1' and 'str2' of length 'm' and 'n' respectively. A java file is represented as "*.java" where "*" is a non-empty string and '.java' is the extension of java file which should come at the end. Implement the function to return value as per following conditions:
6. Implement the following function
int AreaOfTriangle(int a, int b, int c);
The accepts a, b and c as its argument. Then calculate area of the triangle and return square of area.
(area square)^2= s*(s-a)*(s-b)*(s-c), Where s=(a+b+c)/2
Note: Computed values lies within integer range. Consider division operation as integer division
Ex: Input: 5 4 3
Output: 36
int AreaOfTriangle(int a,int b,int c)
{
// code goes here
}
Ans:
{
int s,A;
s=(a+b+c)/2;
A=s*(s-a)*(s-b)*(s-c);
return A;
}
7. you are required to implement the following function
int SumTwiceIndices(int arr[ ],int n, int start)
Where 'arr' is an array of 'n' integers and 'start' is an integer.You are given the initial selected index 'start'. Calculate the sum of elements in arr at selected indices, such that each selected index except the initial selected index is twice the previous selected index.
Note: if arr=NULL, return -1
if start=0 return the value of arr[start]
Ex: Input: 20 42 4 68 17 34 99 74 79 82
n=10
start=2
Output: 100