Programing Logic
Slot 1
Q1. Which argument is passed to fflush()?
A.no parameters
B.stdin
C.stdout
D.stderr
Answer: Option B
Q2. What will be the output for the below? Enter your answer only as Numeral
public Class Main
{
public static void main(string[])
{
int x=1/2;
if(x==0.5)
System.out.println(x+1);
else
System.out.println(x*2);
}
}
Answer: 0
Q3. What is the name of the method that examines a particular data entity and determines
what data elements need to be associated?
A. Entity relationship diagram
B. Logic Data modeling
C. Customer Entities
D. Functional Primitive
Answer: Option A
Q4. What will be the output of the below code?
public class Main
{
static int num=30;
static class inner
{
void msg()
{
System.out.Println(‘Num: num++);}
}
public static void main(string args[])
{
Main.Inner tw=new Main.Inner();
tw.msg()
}
}
Answer: 30
Q5. Select the correct code for opening a file for writing in binary mode
A. File*f =fwriteb(“abc.bin”)
B. File*f = fopen(“abc.bin”,”bw”)
C. File*f = fopen(“abc.bin”,”wb”)
D. File*f =fwrite(“abc.bin”,”b”)
Answer: Option C
Q6. What will be the output of the below code?
JAVA
JAVA
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
class MainClass
{
public void sort()
{
ArrayList arrayList= new ArrayList();
arrayList.add(“mango”);
arrayList.add(“grapes”);
Iterator iterator = arrayList.iterator();
while(iterator.hasNext())
{
System.out.print(iterator.next() +” “);
}
Collections.sort(arrayList);
}
}
public class Main
{
public static void main(String[] args)
{
MainClass mainclass = new MainClass();
mainclass.sort();
}
}
A. mango grapes
B. Compilation error
C. Collection.sort() throws Concurrent Modification Exception
D. Grapes mango
Answer: Option A
Q7. What is the name of the method that examines a particular data entity and determines
what data elements need to be associated with it?
A. Customer Entities
B. Entity Relationship Diagram
C. Logic Data Modelling
D. Functional Primitive
Answer: Option B
Q8. We cannot overload ______ operator.
A. : :
B. []
C. ()
D. +
Answer: Option A
Q9. Which of the following functions is used to accept strings with white spaces?
A.getWhiteSpaceString();
B.scanf();
C.gets();
D.getstrings();
Answer: Option C
Q10.Which data structure is used to convert expression from one form to another form?
A. Graph
B. Stack
C. LinkedList
D. Queue
Answer: Option B
Q11.What is the mathematical function used to round off 6.23 to 7?
A. floor(6.23)
B. ceil(6.23,7)
C. floor(6.23,7)
D. ceil(6.23)
Answer: Option D
Q12. Which combination of the integer variables a, b and c makes the variable m get the value
4 in the following expression?
m = (a > b) ? (( a > c ) ? a : c) : ((b > c ) ? b : c )
A. a=6, b=3, c=5
B. a=6, b=5, c=3
C. a=5, b=4, c=5
D. a=3, b=4, c=2
Answer: Option D
Q13. Which of the following options best suits for ‘Memory Leak Occurred’
A. Resource allocation pending while debugging the code
B. Program releases resources allocated in the memory
C. Program does not free the memory which is allocated dynamically
D. Occurs due to address assignment failure.
Answer- Option C
Slot 2
Q1..Given here is a scenario. Consider the graph algorithm and answer the given question.
John wants to go to different locations of the city in which he is. He has listed all of them down. However he wants to visit one location before visiting some other location What application of graphs he uses to determine that location?
DFS
Dijkstra’s
BFS
Topological Sorting
Answer: Option D
Q2. What will be the output? public class main {
{
int $ = 5;
}
}
Nothing will print
Symbol not found error
Runtime error
Compile error
Answer: Option A
Q3. What will be printed if the below sample code is executed? Enter your answer only as a NUMERAl
class main
{
public static void main(string args[]}
{
int i,j,x=0; for(i=0;i<5;i++)
for(j=0;j<5;j++){
x=(i+j-1); System.out.print(x); break;
}
}
System.out.print(x);
}
Answer: -101233
Q4..Which among the following is a server – based paradigm?
A. Request for information
Cloud computing
Total Cost of Ownership
Data Validation Routine
Q5. There are two integer numbers X and Y that are between 0 to 25. User stores the value under a 5 bit number. How many minimum bits are required to store the result of the below expression?
Res=3*(X-Y) A.8
B.5
C.7
D.8
Answer: Option D
Explanation: If we perform X-Y the possible answers shall be from -75 to 75. In order to store this we need 8 bits.
Q6. Find Prefix and suffix for the below infix problem statement :
Infix Expression : 11 +20/5*(20-15)^6^5
Prefix Expression: 11 20 15 20 5 – ^^*6 5/+ Postfix Expression: +20/11*5-20^^15 6 5
Prefix Expression: 11 20 5 20 15-6 5^^*/+ Postfix Expression: +11/20 *5^^ -20 15 6 5
Prefix Expression: 11 20 5 20 15 – ^^^/+6 5 Postfix Expression: +11/^^-20*5 20 15 6 5
Prefix Expression: +11/20*5^^-20 15 6 5 Postfix Expression : 11 20 5 20 15 -6 5^^/+
Answer: Option D
Q7. Write the name of a library of functions which is used to perform arithmetic operations on BigInteger and BigDecimal.
Answer: import java.math.*;
Q8. When we declare constant pointer to integer, we CANNOT change:
address in pointer variable
changes are not permitted
either address in pointer variable or value at that address
Value pointed by the pointer
Answer: Option B
Q9. Which among the following is a server-based paradigm?
Request for Information(RFI)
Cloud Computing
Total Cost Of Ownership(TCO)
Data Validation Routine