Вы находитесь на странице: 1из 14

1.

Which of the following statements should be used to obtain a remainder after


dividing 3.14 by 2.1 ?

A. rem = 3.14 % 2.1;


B. rem = modf(3.14, 2.1);
C. rem = fmod(3.14, 2.1);
D. Remainder cannot be obtain in floating point division.
View Answer Discuss in Forum Workspace Report
2.
What are the types of linkages?

A. Internal and External


B. External, Internal and None
C. External and None
D. Internal
View Answer Discuss in Forum Workspace Report
3.
Which of the following special symbol allowed in a variable name?

A. * (asterisk)
B. | (pipeline)
C. - (hyphen)
D. _ (underscore)
View Answer Discuss in Forum Workspace Report
4.
Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();

A. Both are identical


B. No difference, except extern int fun(); is probably in another file
C. int fun(); is overrided with extern int fun();
D. None of these
View Answer Discuss in Forum Workspace Report
5.
How would you round off a value from 1.66 to 2.0?

A. ceil(1.66)
B. floor(1.66)
C. roundup(1.66)
D. roundto(1.66)
View Answer Discuss in Forum Workspace Report
1.
Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1

A. * / % + - =
B. = * / % + -
C. / * % - + =
D. * % / - + =
View Answer Discuss in Forum Workspace Report
2.
Which of the following correctly shows the hierarchy of arithmetic operations in C?

A. / + * -
B. * - / +
C. + - / *
D. / * + -
View Answer Discuss in Forum Workspace Report
3.
Which of the following is the correct usage of conditional operators used in C?

A. a>b ? c=30 : c=40;


B. a>b ? c=30;
C. max = a>b ? a>c?a:c:b>c?b:c
D. return (a>b)?(a:b)
View Answer Discuss in Forum Workspace Report
4.
Which of the following is the correct order if calling functions in the below code?
a = f1(23, 14) * f2(12/4) + f3();

A. f1, f2, f3
B. f3, f2, f1
C. Order may vary from compiler to compiler
D. None of above
View Answer Discuss in Forum Workspace Report
5.
Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&

A. 1, 2
B. 1, 3
C. 2, 4
D. 1, 2, 3
View Answer Discuss in Forum Workspace Report
6.
In mathematics and computer programming, which is the correct order of mathematical
operators ?

A. Addition, Subtraction, Multiplication, Division


B. Division, Multiplication, Addition, Subtraction
C. Multiplication, Addition, Division, Subtraction
D. Addition, Division, Modulus, Subtraction
View Answer Discuss in Forum Workspace Report
7.
Which of the following cannot be checked in a switch-case statement?

A. Character
B. Integer
C. Float
D. enum

1.
What will happen if in a C program you assign a value to an array element whose
subscript exceeds the size of array?

A. The element will be set to 0.


B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.
View Answer Discuss in Forum Workspace Report
2.
What does the following declaration mean?
int (*ptr)[10];
A. ptr is array of pointers to 10 integers
B. ptr is a pointer to an array of 10 integers
C. ptr is an array of 10 integers
D. ptr is an pointer to array
View Answer Discuss in Forum Workspace Report
3.
In C, if you pass an array as an argument to a function, what actually gets passed?

A. Value of elements in array


B. First element of the array
C. Base address of the array
D. Address of the last element of array
View Answer Discuss in Forum Workspace Report

1.
What is (void*)0?

A. Representation of NULL pointer


B. Representation of void pointer
C. Error
D. None of above
View Answer Discuss in Forum Workspace Report
2.
Can you combine the following two statements into one?

char *p;
p = (char*) malloc(100);
A. char p = *malloc(100);
B. char *p = (char) malloc(100);
C. char *p = (char*)malloc(100);
D. char *p = (char *)(malloc*)(100);
View Answer Discuss in Forum Workspace Report
3.
In which header file is the NULL macro defined?

A. stdio.h
B. stddef.h
C. stdio.h and stddef.h
D. math.h
View Answer Discuss in Forum Workspace Report
4.
How many bytes are occupied by near, far and huge pointers (DOS)?

A. near=2 far=4 huge=4


B. near=4 far=8 huge=8
C. near=2 far=4 huge=8
D. near=4 far=4 huge=8
View Answer Discuss in Forum Workspace Report
5.
If a variable is a pointer to a structure, then which of the following operator is
used to access data members of the structure through the pointer variable?

A. .
B. &
C. *
D. ->
View Answer Discuss in Forum Workspace Report
1.
Which of the following function sets first n characters of a string to a given
character?

A. strinit()
B. strnset()
C. strset()
D. strcset()
View Answer Discuss in Forum Workspace Report
2.
If the two strings are identical, then strcmp() function returns

A. -1
B. 1
C. 0
D. Yes
View Answer Discuss in Forum Workspace Report
3.
How will you print \n on the screen?

A. printf("\n");
B. echo "\\n";
C. printf('\n');
D. printf("\\n");
View Answer Discuss in Forum Workspace Report
4.
The library function used to find the last occurrence of a character in a string is

A. strnstr()
B. laststr()
C. strrchr()
D. strstr()
View Answer Discuss in Forum Workspace Report
5.
Which of the following function is used to find the first occurrence of a given
string in another string?

A. strchr()
B. strrchr()
C. strstr()
D. strnset()
View Answer Discuss in Forum Workspace Report

Java

1.
What is the name of the method used to start a thread execution?

A. init();
B. start();
C. run();
D. resume();
View Answer Discuss in Forum Workspace Report
2.
Which two are valid constructors for Thread?

Thread(Runnable r, String name)


Thread()
Thread(int priority)
Thread(Runnable r, ThreadGroup g)
Thread(Runnable r, int priority)
A. 1 and 3
B. 2 and 4
C. 1 and 2
D. 2 and 5
View Answer Discuss in Forum Workspace Report
3.
Which three are methods of the Object class?

notify();
notifyAll();
isInterrupted();
synchronized();
interrupt();
wait(long msecs);
sleep(long msecs);
yield();
A. 1, 2, 4
B. 2, 4, 5
C. 1, 2, 6
D. 2, 3, 4
View Answer Discuss in Forum Workspace Report
4.
class X implements Runnable
{
public static void main(String args[])
{
/* Missing code? */
}
public void run() {}
}
Which of the following line of code is suitable to start a thread ?
A. Thread t = new Thread(X);
B. Thread t = new Thread(X); t.start();
C. X run = new X(); Thread t = new Thread(run); t.start();
D. Thread t = new Thread(); x.run();
View Answer Discuss in Forum Workspace Report
5.
Which cannot directly cause a thread to stop executing?

A. Calling the SetPriority() method on a Thread object.


B. Calling the wait() method on an object.
C. Calling notify() method on an object.
D. Calling read() method on an InputStream object.
View Answer Discuss in Forum Workspace Report

1. What is the stored in the object obj in following lines of code?

box obj;
a) Memory address of allocated memory of object
b) NULL
c) Any arbitrary pointer
d) Garbage
View Answer

2. Which of these keywords is used to make a class?


a) class
b) struct
c) int
d) none of the mentioned
View Answer

3. Which of the following is a valid declaration of an object of class Box?


a) Box obj = new Box();
b) Box obj = new Box;
c) obj = new Box();
d) new Box obj;
View Answer

4. Which of these operators is used to allocate memory for an object?


a) malloc
b) alloc
c) new
d) give
View Answer

5. Which of these statement is incorrect?


a) Every class must contain a main() method
b) Applets do not require a main() method at all
c) There can be only one main() method in a program
d) main() method must be made public
View Answer

6. What is the output of this program?

class main_class
{
public static void main(String args[])
{
int x = 9;
if (x == 9)
{
int x = 8;
System.out.println(x);
}
}
}
a) 9
b) 8
c) Compilation error
d) Runtime error
View Answer

7. Which of the following statements is correct?


a) Public method is accessible to all other classes in the hierarchy
b) Public method is accessible only to subclasses of its parent class
c) Public method can only be called by object of its class
d) Public method can be accessed by calling object of the public class
View Answer

1. What is true about private constructor?


a) Private constructor ensures only one instance of a class exist at any point of
time
b) Private constructor ensures multiple instances of a class exist at any point of
time
c) Private constructor eases the instantiation of a class
d) Private constructor allows creating objects in other classes
View Answer
2. What would be the behaviour if this() and super() used in a method?
a) Runtime error
b) Throws exception
c) compile time error
d) Runs successfully
View Answer

3. What is false about constructor?


a) Constructors cannot be synchronized in Java
b) Java does not provide default copy constructor
c) Constructor can be overloaded
d) �this� and �super� can be used in a constructor
View Answer

4. What is true about Class.getInstance()?


a) Class.getInstance calls the constructor
b) Class.getInstance is same as new operator
c) Class.getInstance needs to have matching constructor
d) Class.getInstance creates object if class does not have any constructor
View Answer

5. What is true about constructor?


a) It can contain return type
b) It can take any number of parameters
c) It can have any non access modifiers
d) Constructor cannot throw an exception
View Answer

6. Abstract class cannot have a constructor.


a) True
b) False
View Answer

7. What is true about protected constructor?


a) Protected constructor can be called directly
b) Protected constructor can only be called using super()
c) Protected constructor can be used outside package
d) protected constructor can be instantiated even if child is in a different
package
View Answer

1. A relational database consists of a collection of


a) Tables
b) Fields
c) Records
d) Keys
View Answer

2. A ________ in a table represents a relationship among a set of values.


a) Column
b) Key
c) Row
d) Entry
View Answer

3. The term _______ is used to refer to a row.


a) Attribute
b) Tuple
c) Field
d) Instance
View Answer

4. The term attribute refers to a ___________ of a table.


a) Record
b) Column
c) Tuple
d) Key
View Answer

5. For each attribute of a relation, there is a set of permitted values, called the
________ of that attribute.
a) Domain
b) Relation
c) Set
d) Schema
View Answer

6. Database __________ which is the logical design of the database, and the
database _______ which is a snapshot of the data in the database at a given instant
in time.
a) Instance, Schema
b) Relation, Schema
c) Relation, Domain
d) Schema, Instance
View Answer

7. Course(course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a _________
a) Relations, Attribute
b) Attributes, Relation
c) Tuple, Relation
d) Tuple, Attributes
View Answer

advertisement

8. Department (dept name, building, budget) and Employee (employee_id, name, dept
name, salary)
Here the dept_name attribute appears in both the relations. Here using common
attributes in relation schema is one way of relating ___________ relations.
a) Attributes of common
b) Tuple of common
c) Tuple of distinct
d) Attributes of distinct
View Answer

9. A domain is atomic if elements of the domain are considered to be ____________


units.
a) Different
b) Indivisbile
c) Constant
d) Divisible
View Answer

10. The tuples of the relations can be of ________ order.


a) Any
b) Same
c) Sorted
d) Constant
View Answer

1. Which one of the following is a set of one or more attributes taken collectively
to uniquely identify a record?
a) Candidate key
b) Sub key
c) Super key
d) Foreign key
View Answer

2. Consider attributes ID, CITY and NAME. Which one of this can be considered as a
super key?
a) NAME
b) ID
c) CITY
d) CITY, ID
View Answer

3. The subset of a super key is a candidate key under what condition?


a) No proper subset is a super key
b) All subsets are super keys
c) Subset is a super key
d) Each subset is a super key
View Answer

4. A _____ is a property of the entire relation, rather than of the individual


tuples in which each tuple is unique.
a) Rows
b) Key
c) Attribute
d) Fields
View Answer

5. Which one of the following attribute can be taken as a primary key?


a) Name
b) Street
c) Id
d) Department
View Answer

6. Which one of the following cannot be taken as a primary key?


a) Id
b) Register number
c) Dept_id
d) Street
View Answer

7. An attribute in a relation is a foreign key if the _______ key from one relation
is used as an attribute in that relation.
a) Candidate
b) Primary
c) Super
d) Sub
View Answer

advertisement
8. The relation with the attribute which is the primary key is referenced in
another relation. The relation which has the attribute as a primary key is called
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
View Answer

9. The ______ is the one in which the primary key of one relation is used as a
normal attribute in another relation.
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
View Answer

10. A _________ integrity constraint requires that the values appearing in


specified attributes of any tuple in the referencing relation also appear in
specified attributes of at least one tuple in the referenced relation.
a) Referential
b) Referencing
c) Specific
d) Primary
View Answer

1. Which one of the following is used to define the structure of the relation,
deleting relations and relating schemas?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
View Answer

2. Which one of the following provides the ability to query information from the
database and to insert tuples into, delete tuples from, and modify tuples in the
database?
a) DML(Data Manipulation Langauge)
b) DDL(Data Definition Langauge)
c) Query
d) Relational Schema
View Answer

3.

CREATE TABLE employee (name VARCHAR, id INTEGER)


What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint
View Answer

4.

SELECT * FROM employee


What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint
View Answer

5. The basic data type char(n) is a _____ length character string and varchar(n) is
_____ length character.
a) Fixed, equal
b) Equal, variable
c) Fixed, variable
d) Variable, equal
View Answer

6. An attribute A of datatype varchar(20) has the value �Avi�. The attribute B of


datatype char(20) has value �Reed�. Here attribute A has ____ spaces and attribute
B has ____ spaces.
a) 3, 20
b) 20, 4
c) 20, 20
d) 3, 4
View Answer

7. To remove a relation from an SQL database, we use the ______ command.


a) Delete
b) Purge
c) Remove
d) Drop table
View Answer

8.

advertisement

DELETE FROM r; //r - relation


This command performs which of the following action?
a) Remove relation
b) Clear relation entries
c) Delete fields
d) Delete rows
View Answer

9.

INSERT INTO instructor VALUES (10211, �Smith�, �Biology�, 66000);


What type of statement is this?
a) Query
b) DML
c) Relational
d) DDL
View Answer

10. Updates that violate __________ are disallowed.


a) Integrity constraints
b) Transaction control
c) Authorization
d) DDL constraints
View Answer

1. Process of inserting an element in stack is called ____________


a) Create
b) Push
c) Evaluation
d) Pop
View Answer

2. Process of removing an element from stack is called __________


a) Create
b) Push
c) Evaluation
d) Pod
View Answer

3. In a stack, if a user tries to remove an element from empty stack it is called


_________
a) Underflow
b) Empty collection
c) Overflow
d) Garbage Collection
View Answer

4. Pushing an element into stack already having five elements and stack size of 5 ,
then stack becomes
a) Overflow
b) Crash
c) Underflow
d) User flow
View Answer

5. Entries in a stack are �ordered�. What is the meaning of this statement?


a) A collection of stacks is sortable
b) Stack entries may be compared with the �<� operation
c) The entries are stored in a linked list
d) There is a Sequential entry that is one by one
View Answer

6. Which of the following applications may use a stack?


a) A parentheses balancing program
b) Tracking of local variables at run time
c) Compiler Syntax Analyzer
d) All of the mentioned
View Answer

7. Consider the usual algorithm for determining whether a sequence of parentheses


is balanced.
The maximum number of parentheses that appear on the stack AT ANY ONE TIME when the
algorithm analyzes: (()(())(())) are:
a) 1
b) 2
c) 3
d) 4 or more
View Answer

8. Consider the usual algorithm for determining whether a sequence of parentheses


is balanced.
Suppose that you run the algorithm on a sequence that contains 2 left parentheses
and 3 right parentheses (in some order).
The maximum number of parentheses that appear on the stack AT ANY ONE TIME during
the computation?
a) 1
b) 2
c) 3
d) 4 or more
View Answer

9. What is the value of the postfix expression 6 3 2 4 + � *:


a) Something between -5 and -15
b) Something between 5 and -5
c) Something between 5 and 15
d) Something between 15 and 100
View Answer

10. Here is an infix expression: 4 + 3*(6*3-12). Suppose that we are using the
usual stack algorithm to convert the expression from infix to postfix notation.
The maximum number of symbols that will appear on the stack AT ONE TIME during the
conversion of this expression?
a) 1
b) 2
c) 3
d) 4
View Answer

1. What is the maximum number of children that a binary tree node can have?
a) 0
b) 1
c) 2
d) 3
View Answer

4. How many common operations are performed in a binary tree?


a) 1
b) 2
c) 3
d) 4
View Answer

5. What is the traversal strategy used in the binary tree?


a) depth-first traversal
b) breadth-first traversal
c) random traversal
d) preorder traversal
View Answer

6. How many types of insertion are performed in a binary tree?


a) 1
b) 2
c) 3
d) 4
View Answer

8. General ordered tree can be encoded into binary trees.


a) true
b) false
View Answer

9. How many bits would a succinct binary tree occupy?


a) n+O(n)
b) 2n+O(n)
c) n/2
d) n
View Answer

10. The average depth of a binary tree is given as?


a) O(N)
b) O(vN)
c) O(N2)
d) O(log N)
View Answer

2. RAD stands for


a) Relative Application Development
b) Rapid Application Development
c) Rapid Application Document
d) None of the mentioned
View Answer

9. SDLC stands for


a) Software Development Life Cycle
b) System Development Life cycle
c) Software Design Life Cycle
d) System Design Life Cycle

Вам также может понравиться