Posts by Adit Gupta

Author Biographical Info: Not available

How to calculate electricity bill using a C++ program

By Adit Gupta

In this tutorial, we will be learning to calculate the electricity bill. I will be doing this with the help of total number of units consumed. It is straightforward, and all you ne.... Read More

How to set bits in all numbers from 1 to n in C ++

By Adit Gupta

In this tutorial, I will be showing to set bits of all numbers from 1 to n. I will be using C++ to implement my approach. Setting bits of a number basically means to change the bit.... Read More

Check if binary representation of a number is palindrome in Java

By Adit Gupta

In this tutorial, I will be explaining if the binary of a number is palindrome or not in Java. A palindrome number is one which when reversed, yields the same number with which we .... Read More

Turning off a particular bit in a number in Java

By Adit Gupta

In this tutorial, we will learn to turn off a bit of a number. We can use bitwise operators to carry out turning off a bit. However, if you wish to skip these operators you can man.... Read More

Unbounded fractional knapsack problem in Java

By Adit Gupta

In this tutorial, I will show how to solve the problem of unbounded fractional knapsack problem in Java language. It is somewhat different from the conventional knapsack problem. T.... Read More