Welcome To Tutorialspoint.dev
Officially launched 18th May 2019

A C Programming Language Puzzle

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...

A nested loop puzzle

Which of the following two code segments is faster? Assume that compiler makes no optimizations. /* FIRST */ for(i=0;i&lt;10;i++) &#xA0;&#xA0;for(j=0;j&l...

A C/C++ Function Call Puzzle

Consider the following program. Predict the output of it when compiled with C and C++ compilers. void func() { &#xA0;&#xA0;&#xA0;&#xA0;/* definition */ } ...

Programming puzzle (Assign value without any control statement)

Given four integers &#x2018;a&#x2019;, &#x2018;b&#x2019;, &#x2018;y&#x2019; and &#x2018;x&#x2019;, where &#x2018;x&#x2019; can only be either zero or one. Your task i...

A Product Array Puzzle

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[...

How to check if an instance of 8 puzzle is solvable?

What is 8 puzzle? Given a 3&#xD7;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...

Solving Cryptarithmetic Puzzles Backtracking-8

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...

Magnet Puzzle Backtracking-9

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...

C++ program for Solving Cryptarithmetic Puzzles

Newspapers and magazines often have crypt-arithmetic puzzles of the form: Examples: Input : s1 = SEND, s2 = &quot;MORE&quot;, s3 = &quot;MONEY&quot; Output : One of t...

A Boolean Array Puzzle

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...