1
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C program:
void foo (int n, int sum) {
  int k = 0, j = 0;
  if(n==0) return;
  k=n%10; j = n /10;
  sum = sum + k;
  foo(j, sum);
  printf("%d",k);
}
int main () {
  int a = 2048, sum = 0;
  foo(a, sum);
  printf("%d\n", sum);
}
What does the above program print?
A
8, 4, 0, 2, 14
B
8, 4, 0, 2, 0
C
2, 0, 4, 8, 14
D
2, 0, 4, 8, 0
2
GATE CSE 2005
MCQ (Single Correct Answer)
+1
-0.3
Which one of the following are essential features of an object-oriented programming language?
i) Abstraction and encapsulation
ii) Strictly-typedness
iii) Type-safe property coupled with sub-type rule
iv) Polymorphism in the presence of inheritance
A
(i) and (ii) only
B
(i) and (iv) only
C
(i), (ii) and (iv) only
D
(i), (ii) and (iii) only
3
GATE CSE 2005
MCQ (Single Correct Answer)
+1
-0.3
An Abstract Data Type (ADT) is
A
same as an abstract class
B
a data type that cannot be instantiated
C
a data type for which only the operations defined on it can be used, but none else
D
all of the above
4
GATE CSE 2005
MCQ (Single Correct Answer)
+1
-0.3
A common property of logic programming languages and functional languages is:
A
both are procedural languages
B
both are based on l-calculus
C
both are declarative
D
both use Horn-clauses
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12