Give a = 12 and b = 36 write a C function/macro that returns 3612 without using arithmetic, strings and predefined functions.
We strongly recommend you to minimize y...
Share
Which of the following two code segments is faster? Assume that compiler makes no optimizations.
/* FIRST */
for(i=0;i<10;i++)
  for(j=0;j&l...
Share
Consider the following program. Predict the output of it when compiled with C and C++ compilers.
void func()
{
    /* definition */
} ...
Share
Given four integers ‘a’, ‘b’, ‘y’ and ‘x’, where ‘x’ can only be either zero or one. Your task i...
Share
Given an array arr[] of n integers, construct a Product Array prod[] (of same size) such that prod[i] is equal to the product of all the elements of arr[] except arr[...
Share
What is 8 puzzle?
Given a 3×3 board with 8 tiles (every tile has one number from 1 to 8) and one empty space. The objective is to place the numbers on tiles in o...
Share
Newspapers and magazines often have crypt-arithmetic puzzles of the form:
SEND
+ MORE
--------
MONEY
--------
The goal here is to assign each letter a digit fr...
Share
The puzzle game Magnets involves placing a set of domino-shaped magnets (or electrets or other polarized objects) in a subset of slots on a board so as to satisfy a s...
Share
Newspapers and magazines often have crypt-arithmetic puzzles of the form:
Examples:
Input : s1 = SEND, s2 = "MORE", s3 = "MONEY"
Output : One of t...
Share
Input: A array arr[] of two elements having value 0 and 1
Output: Make both elements 0.
Specifications: Following are the specifications to follow.
1) It is guarant...
Share