3 different C programs to find the remainder without modulo

3 different ways in C to find the remainder of a division without using the modulo operator. Learn how to write C programs with examples.

Read

C program to count number of 1 using Brian Kernighan’s Algorithm

In this example, we will learn how to find the count of 1 in the binary representation of a number. For example, the binary value of 3 is 0011 and total number of 1 in this representation is 2. Different ways are there to calculate the total count. Brian Kernighan’s Algorithm is one of them. The complexity of this algorithm is O(log(n)).

Read

Java ListIterator set method example

In this example, we will learn how to use ListIterator in Java . ListIterator is an interface that extends Iterator interface. Using it, we can iterate a list in either direction. During the iteration, we can get the current position of the iterator and the value of the current element.

Read

Python program to remove characters from odd or even index of a string

In this example, we will write one program in Python 3 to remove all characters positioned on Even or Odd index. Python string is immutable, i.e. we can’t modify one string directly. e.g. if you want to change the character on index 3, you can’t change it directly like arrays. We need to create one different string if we want to make any modification to a string.

Read

C program to check if a year is leap year or not

To check if a year is leap year or not, we need to check if it is divisible by 4 or not. A year is leap year if it is divisible by 4 and for century years, if it also divisible by 400. In this example, we will learn how to check if a year is leap year or not in C programming language. Let's take a look into the algorithm first :.

Read

Java program to remove all white space from a string

In this tutorial, we will learn how to remove all blank characters (like whitespace,tabs,newline etc) from a string. We will learn two different methods to achieve this.

Read

C program to calculate the total number of lines in a file

In this tutorial, we will learn how to find the total number of lines in a file using C programming language. To run the program, just change the path of the file to your own file path. Before going in details how this program works, let's take a look into the program first :.

Read

Python program to find the sum of all values of a dictionary

In this tutorial, we will learn how to find the sum of all the values of a dictionary in python.

Read

Python program to sort values of one list using second list

In this example program, we will learn how to sort elements of one list by using elements of a different list.

Read

C program to find the power of a number using loop

In this 'C' example program, we will learn how to find the power of a number . We will take both inputs from the user. Then we will calculate the power and print out the result.

Read