## GATE | GATE CS 2013 | Question 6October 17, 2013

Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort? (A)… Read More »

## GATE | GATE CS 2013 | Question 65

In the following truth table, V = 1 if and only if the input is valid. What function does the truth table represent? (A) Priority… Read More »

## GATE | GATE CS 2013 | Question 4

The smallest integer that can be represented by an 8-bit number in 2’s complement form is (A) -256 (B) -128 (C) -127 (D) 0 Answer:… Read More »

## GATE | GATE CS 2013 | Question 3

Which one of the following does NOT equal to (A) A (B) B (C) C (D) D Answer: (A) Explanation:   First of all, you… Read More »

## GATE | GATE CS 2013 | Question 2

Suppose p is the number of cars per minute passing through a certain road junction between 5 PM and 6 PM, and p has a… Read More »

## GATE | GATE CS 2013 | Question 1

A binary operation on a set of integers is defined as x y = x2 + y2. Which one of the following statements is TRUE… Read More »

## C | Variable Declaration and Scope | Question 6

Output? (A) x = 1, y = 2, z = 3 x = 10, y = 20.000000, z = 3 x = 1, y =… Read More »

## C | Variable Declaration and Scope | Question 5October 16, 2013

Output? (A) 10 (B) Compiler Errror (C) Garbage Value Answer: (B) Explanation: x is not accessible. The curly brackets define a block of scope. Anything… Read More »

## C | Variable Declaration and Scope | Question 4

(A) 10 (B) Compiler Error: var is not defined (C) 0 Answer: (A) Explanation: If a variable is only declared and an initializer is also… Read More »

## C | Variable Declaration and Scope | Question 3

(A) Compiler Error: var is not defined (B) 20 (C) 0 Answer: (A) Explanation: var is only declared and not defined (no memory allocated for… Read More »

## C | Variable Declaration and Scope | Question 2

Predict the output (A) Garbage Value (B) 20 (C) Compiler Error Answer: (A) Explanation: First var is declared, then value is assigned to it. As… Read More »

## C | Variable Declaration and Scope | Question 1

Consider the following two C lines Which of the following statements is correct (A) Both statements only declare variables, don’t define them. (B) First statement… Read More »

## How to count set bits in a floating point number in C?

Given a floating point number, write a function to count set bits in its binary representation.

## C++ | Templates | Question 10

Output? (A) Compiler Error (B) 1024 (C) 2 (D) 1 Answer: (B) Explanation: This is an example of template metaprogramming. The program mainly calculates 2^10.… Read More »

## C++ | Templates | Question 9

Output? (A) 20 (B) Called 20 (C) Compiler Error Answer: (B) Explanation: Above program is an example of template specialization. Sometime we want a different… Read More »