11. What
is the effect of the following C code?
for(int i=1; i≤5; i=i+½)
printf(“%d,”,i);
(A) It prints 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5,
5, and stops
(B) It prints 1, 2, 3, 4, 5, and stops
(C) It prints 1, 2, 3, 4, 5, and repeats
forever
(D) It prints 1, 1, 1, 1, 1, and repeats
forever
Answer: D
12. Consider
the following declaration in C:
char a[];
char *p;
Which of the following statement is not a
valid statement?
(A) p=a;
(B) p=a+2;
(C) a=p;
(D) p=&a[2];
Answer: C
13. Consider
the following C code:
{ int a=5, b=9;
float r;
r=b/a; }
What is the value of r ?
(A) 1.8
(B) 1.0
(C) 2.0
(D) 0.0
Answer: B
14. Function
overloading is a concept in which:
(A) a function is used to implement lots of
tasks at the same time.
(B) a function is called too many number of
times by another function.
(C) a function provides common interface to
the user to carry out possibly different functions in each call.
(D) a function is computationally too
expensive for the system to handle.
Answer: C
15. Which
of the following is true?
(A) A “static” member of a class cannot be
inherited by its derived class.
(B) A “static” member of a class can be
initialized only within the class it is a member
of.
(C) A “static” member of a class can be initialized
before an object of that class is created.
(D) Since “static” member of a class is
actually a global element, it does not require a class/object qualifier to access
it independently of class/object.
Answer: C
16. A
superkey for an entity consists of:
(A) one attribute only
(B) at least two attributes
(C) at most two attributes
(D) one or more attributes
Answer: D
17. Which
of the following set of keywords constitutes a mapping in SQL?
(A) SELECT, FROM, TABLE
(B) SELECT, FROM, WHERE
(C) CONNECT, TABLE, CREATE
(D) SELECT, TABLE, INSERT
Answer: B
18. If
a relation is in 2NF then:
(A) every candidate key is a primary key
(B) every non-prime attribute is fully
functionally dependent on each relation key
(C) every attribute is functionally
independent
(D) every relational key is a primary key
Answer: B
19. Which
of the following is true?
(A) A relation in 3NF is always in BCNF
(B) A relation in BCNF is always in 3NF
(C) BCNF and 3NF are totally different
(D) A relation in BCNF is in 2NF but not in
3NF
Answer: B
20. Consider
the query : SELECT student_name FROM student_data WHERE rollno (SELECT rollno
FROM student_marks WHERE SEM1_MARK=SEM2_MARK);
Which of the following is true?
(A) It gives the name of the student whose
marks in semester 1 and semester 2 are same.
(B) It gives all the names and roll nos of those students whose marks in semester 1
and semester 2 are same.
(C) It gives the names of all the students
whose marks in semester 1 and semester 2 are same.
(D) It gives roll numbers of all students
whose marks in semester 1 and semester 2 are same.
Answer: C
0 Comments