Given an binary array of size two having alteast one element as zero, write a single line function to set both its elements to zero. Use of ternary operator and direct assignment of elements are not allowed.
Given an unsorted array of integers whose each element lies in range 0 to n-1 where n is the size of the array, rearrange array such that A[A[i]] is set to i for every element A[i] in the array.
Given a number, find out if it is even or odd without using any conditional statement (if-else) or ternary operator.
Given an array where all its elements are sorted except two elements which were swapped, sort the array in linear time. Assume there are no duplicates in the array.
Write an program to reverse a string in Java. For example, reverse of string “Techie Delight” is “thgileD eihceT”.
Given an array constructed from another array by taking sum of every distinct pair in it, decode the array to get back the original array elements.
Given two integers x and n where n is non-negative, efficiently compute the value of power function pow(x, n).
Given a MxN matrix, print matrix in spiral order.
Write a program to print all numbers between 1 to N without using semicolon.
Given two integers, swap them without using any third variable.
What should be the if condition in below code snippet, so that output would be “Hello World”. if “condition” printf (“Hello”); else printf(“World”);
Given three integers, find maximum and minimum number between them without using conditional statement or ternary operator.