Arnab Chakraborty has Published 4458 Articles

C++ Program to find sum of even factors of a number?

Arnab Chakraborty

Arnab Chakraborty

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

227 Views

In this section we will see how we can get the sum of all even prime factors of a number in an efficient way. There is a number say n = 480, we have to get all factor of this. The prime factors of 480 are 2, 2, 2, 2, ... Read More

C++ Program to Split the array and add the first part to the end?

Arnab Chakraborty

Arnab Chakraborty

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

362 Views

Here we will see how to split an array, and add the first part after splitting at the end position. Suppose the array contents are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. We want to cut this intro two parts. The first part is from index 0 ... Read More

C/C++ Program for Finding the vertex, focus and directrix of a parabola?

Arnab Chakraborty

Arnab Chakraborty

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

100 Views

Here we will see how to find the vertex, focus directrix of a parabola using C or C++ program. To get these parameters we need the general equation of a parabola. The general formula is βˆ’π‘¦ = π‘Žπ‘₯2Β + 𝑏π‘₯ + 𝑐The values of a, b and c are given.The formula ... Read More

C/C++ Program to find Product of unique prime factors of a number?

Arnab Chakraborty

Arnab Chakraborty

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

418 Views

In this section we will see how we can get the product of unique prime factor of a number in an efficient way. There is a number say n = 1092, we have to get product of unique prime factors of this. The prime factors of 1092 are 2, 2, ... Read More

C/C++ Program to Find reminder of array multiplication divided by n ?

Arnab Chakraborty

Arnab Chakraborty

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

164 Views

Here we will see how to calculate the remainder of array multiplication after dividing the result by n. The array and the value of n are supplied by the user. Suppose the array is like {12, 35, 69, 74, 165, 54} so the multiplication will be (12 * 35 * ... Read More

Addition of two numbers without propagating Carry?

Arnab Chakraborty

Arnab Chakraborty

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

364 Views

Here we will see one problem, where we will add two n digit numbers but the carry will not be propagated. We can understand this concept through an example βˆ’So we can see that here only digits are getting added and answer is placed. Here is one trick. We have ... Read More

What's the difference between sizeof and alignof?

Arnab Chakraborty

Arnab Chakraborty

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

349 Views

Here we will see what are the differences of sizeof and the alignof operator in C++. The alognof() operator is introduced in C++11.The alignof() operator is used to get the alignment in bytes. It requires instances of type. the type is either complete type or a reference type. There is ... Read More

All permutations of a string using iteration?

Arnab Chakraborty

Arnab Chakraborty

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

489 Views

In this section we will see how to get all permutations of a string. The recursive approach is very simple. It uses the back-tracking procedure. But here we will use the iterative approach.All permutations of a string ABC are like {ABC, ACB, BAC, BCA, CAB, CBA}. Let us see the ... Read More

All reverse permutations of an array using STL in C++?

Arnab Chakraborty

Arnab Chakraborty

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

147 Views

In this section we will see how to generate all reverse permutations using the STL in C++. The forward and reverse permutation of some numbers like (1, 2, 3) will be like below βˆ’Forward permutation1, 2, 3 1, 3, 2 2, 1, 3 2, 3, 1 3, 1, 2 3, ... Read More

Area of triangle formed by the axes of co-ordinates and a given straight line?

Arnab Chakraborty

Arnab Chakraborty

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

70 Views

Here we will see how to get the area of a triangle formed by the x and y axis and another straight line. The diagram will be look like below. The equation of the straight line is βˆ’π‘Žπ‘₯+𝑏𝑦+𝑐=0The line is cutting the x-axis at the point B, and cutting the ... Read More

Advertisements