Test: Programming in C++, C & Java- 2


Test Description

15 Questions MCQ Test Question Bank for GATE Computer Science Engineering | Test: Programming in C++, C & Java- 2

Test: Programming in C++, C & Java- 2 for Computer Science Engineering (CSE) 2022 is part of Question Bank for GATE Computer Science Engineering preparation. The Test: Programming in C++, C & Java- 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Programming in C++, C & Java- 2 MCQs are made for Computer Science Engineering (CSE) 2022 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Programming in C++, C & Java- 2 below.
Solutions of Test: Programming in C++, C & Java- 2 questions in English are available as part of our Question Bank for GATE Computer Science Engineering for Computer Science Engineering (CSE) & Test: Programming in C++, C & Java- 2 solutions in Hindi for Question Bank for GATE Computer Science Engineering course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Programming in C++, C & Java- 2 | 15 questions in 45 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study Question Bank for GATE Computer Science Engineering for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
1 Crore+ students have signed up on EduRev. Have you?
Test: Programming in C++, C & Java- 2 - Question 1

What does the following C-statement declare? 
int (*f) (int *);

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 1

int (*f) (int*);
return type int, (*f) is a pointer to a function the argument is (int*) an integer pointer So, int (*f) (int*) means a pointer to a function that takes an integer pointer as an argument and returns an integer.

Test: Programming in C++, C & Java- 2 - Question 2

An Abstract Data Type (ADT) is

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 2

The abstract data type (ADT) refers to a programmer defined data type together with a set of operations that can be performed on that data so the choice (c) is correct.

Test: Programming in C++, C & Java- 2 - Question 3

A common property of logic programming languages and functional languages is

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 3

A common property of logic programming languages and functional languages is both are declarative because we declare any statement before we will use it.

Test: Programming in C++, C & Java- 2 - Question 4

Which of the following are essential features of an object-oriented programming languages?
1. Abstraction and encapsulation
2. Strictiy-typedness
3. Type-safe property coupled with sub-type rule
4. Polymorphism in the presence of inheritance

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 4

Object oriented programming language is Object based PL + Abstraction + Inheritance.
The last two (abstraction and inheritance) are must for any L to be OOPL.

Test: Programming in C++, C & Java- 2 - Question 5

Early binding refers to a binding performed at compile time and late binding refers to a binding performed at execution time. Consider the following statements:
(i) Static scope facilitates w1 bindings.
(ii) Dynamic scope requires w2 bindings.
(iii) Early bindings w3 execution efficiency.
(iv) Late bindings w4 execution efficiency.
The right choices of w1, w2, w3 and w4 (in that order) are

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 5

(i) Static scoping facilitate early binding because it is done at compile time.
(ii) Dynamic scoping require late binding because it is done at runt time.
(iii) Early binding increases execution efficiency because both necessary and uncessary things are load at compile time.
(iv) Late binding decrease execution efficiency because only necessary things are loaded when they are needed.

Test: Programming in C++, C & Java- 2 - Question 6

Match the programming paradigms and languages given in the following table:

Codes:

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 6

Imperative: C, Fortran 77, Pascal
Object oriented : C + + , Smalltalk, Java
Functional: Lisp
Logic: Prolog

Test: Programming in C++, C & Java- 2 - Question 7

Which combination of the integer variables x, y and z makes the variable a get the value 4 in the following expression?
a = (x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z)

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 7

a = (x < y) ? ((x < z) ? x : z) : ((y > z) ? y: z)
In C “ ? is a ternary operator the syntax is (exp1 ? exp2 : exp3). it means if exp1 is true print exp2 else exp3.
Let x = 3, y = 4, z = 2.
⇒ a = (3 > 4) ? ((3 > 2) ? 3 : 2 ) : ((4 > 2) ? 4 : 2) 
a = (3 > 4) ? 3 : 4
a = 4

Test: Programming in C++, C & Java- 2 - Question 8

What does the following program print? 

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 8

In the given program it begin from main function, i and j are globally initialized by 0 and 1. So when we call function f(& i, & j) the address of i and j are passed.
when p = q and *p = 2 means
*q = 2, so value of *q is passed. 
and value of *q return to j.
Value of i and j are 0 and 2 respected.
So print i (“ % d % d ”, i, j) gives output (0, 2).

Test: Programming in C++, C & Java- 2 - Question 9

What is the value printed by the following C program?

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 9


So f(a, 6) → first this call
Thus is the number stored in the array and we can access these by using

Test: Programming in C++, C & Java- 2 - Question 10

What does the following fragment of C program print?

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 10


P + P[3] - P[1] = 2000 + 69 - 65 
= 2004
⇒ 2011 string will be printed.
(From 2004 Address)

Test: Programming in C++, C & Java- 2 - Question 11

Consider the following program in C language: 

Which one of the following statements is TRUE?

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 11

Test: Programming in C++, C & Java- 2 - Question 12

Consider the C function given below:

Which one of the following is TRUE?

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 12

f(50) goes into infinite loop by calling f(i) recursively for i = j = 50.

Test: Programming in C++, C & Java- 2 - Question 13

Consider the following C program segment:

What will be printed by the program?

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 13



Therefore the output is 1204

Test: Programming in C++, C & Java- 2 - Question 14

Which of the following comments are not true?
1. C provides no input-output features
2. C provides no file access features
3. C borrowed most of its ideas from BCPL
4. C provides no features to manipulate composite objects

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 14

BCPL: Basic Combined Programming Language primary used for system software and called simply B.

Test: Programming in C++, C & Java- 2 - Question 15

Which of the following are not keywords in C?

Detailed Solution for Test: Programming in C++, C & Java- 2 - Question 15

"if" is keyword in C not “IF”.

Use Code STAYHOME200 and get INR 200 additional OFF
Use Coupon Code
Information about Test: Programming in C++, C & Java- 2 Page
In this test you can find the Exam questions for Test: Programming in C++, C & Java- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Programming in C++, C & Java- 2, EduRev gives you an ample number of Online tests for practice