## Write a program to reverse digits of a number

Write a program to reverse digits of an integer. Examples : Input : num = 12345 Output : 54321 Input : num = 876 Output… Read More »

## Program to find parity

Parity: Parity of a number refers to whether it contains an odd or even number of 1-bits. The number has “odd parity”, if it contains… Read More »

## Write an Efficient Method to Check if a Number is Multiple of 3

The very first solution that comes to our mind is the one that we learned in school. If sum of digits in a number is… Read More »

## Given an array A[] and a number x, check for pair in A[] with sum as x

Write a program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in S… Read More »

## Smallest power of 2 greater than or equal to n

Write a function that, for a given no n, finds a number p which is greater than or equal to n and is a smallest… Read More »

## Write a program to calculate pow(x,n)

Given two integers x and n, write a function to compute xn. We may assume that x and n are small and overflow doesn’t happen.… Read More »

## Program for Sum the digits of a given number

Given a number, find sum of its digits. Examples : Input : n = 687 Output : 21 Input : n = 12 Output :… Read More »

## How will you print numbers from 1 to 100 without using loop?

If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0”… Read More »