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.
ReadIn 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)).
ReadIn 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.
ReadIn 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.
ReadTo 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 :.
ReadIn 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.
ReadIn 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 :.
ReadIn this tutorial, we will learn how to find the sum of all the values of a dictionary in python.
ReadIn this example program, we will learn how to sort elements of one list by using elements of a different list.
ReadIn 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