Arnab Chakraborty has Published 4458 Articles

C/C++ Program to Find the Number Occurring Odd Number of Times?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

94 Views

In this program we will see how we can get a number that is occurring odd number of times in an array. There are many different approaches. One of the easiest approach is performing ZOR operation. If a number is XORed with itself, it will be 0. So if a ... Read More

C/C++ program to shutdown a system?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

473 Views

Here we will see how we can shut down the system by writing a simple C or C++ code. The shutdown process varies in different OS. If we are Linux user, we can use this terminal command to shut down.shutdown –P nowIf we are using Windows system, we can use ... Read More

Aliquot sum in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

173 Views

Here we will see what is the Aliquot sum? The Aliquot sum of n is the sum of all perfect factors of a n except the n. For example, if the number is 20, then the perfect factors are (1, 2, 4, 5, 10). So the Aliquot sum is 22.One ... Read More

Alternate Primes till N in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

857 Views

Here we will see how to print all alternate prime numbers till N. The alternate prime numbers are like below. Suppose N = 15. So the prime numbers till N are {2, 3, 5, 7, 11, 13}. The alternate prime numbers are {2, 5, 11}. Let us see how we ... Read More

Arithmetic Mean in c++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

1K+ Views

The Arithmetic Mean is just the average of numbers. In this program we will see how we can find the arithmetic mean from a set of numbers. The function will take the number set, and the number of elements. Out task is just adding each element, then divide it by ... Read More

asin() function for complex number in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

87 Views

Here we will see the asin() method for the complex numbers. The complex numbers can be used using complex header file. In that header file the asin () function is also present. This is complex version of normal asin () function. This is used to find complex arc sine of ... Read More

atan() function for complex number in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

101 Views

Here we will see the atan() method for the complex numbers. The complex numbers can be used using complex header file. In that header file the atan() function is also present. This is complex version of normal atan() function. This is used to find complex arc tan of a complex ... Read More

BFS using STL for competitive coding in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

519 Views

The Breadth First Search (BFS) traversal is an algorithm, which is used to visit all of the nodes of a given graph. In this traversal algorithm one node is selected and then all of the adjacent nodes are visited one by one. After completing all of the adjacent vertices, it ... Read More

C/C++ Program for Largest Sum Contiguous Subarray?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

329 Views

An array of integers is given. We have to find sum of all elements which are contiguous. Whose sum is largest, that will be sent as output.Using dynamic programming we will store the maximum sum up to current term. It will help to find sum for contiguous elements in the ... Read More

C Program for Basic Euclidean algorithms?

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jul-2019 22:30:26

165 Views

Here we will see the Euclidean algorithm to find the GCD of two numbers. The GCD (Greatest Common Divisor) can easily be found using Euclidean algorithm. There are two different approach. One is iterative, another one is recursive. Here we are going to use the recursive Euclidean algorithm.AlgorithmEuclideanAlgorithm(a, b)begin   ... Read More

Advertisements