Sudhir sharma has Published 1206 Articles

C++ Program for the Comb Sort?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 11:27:25

434 Views

Comb sort is similar to bubble sort and cocktail sort. Comb sort doesn’t start off looking at adjacent elements but instead looks at elements a certain number of indexes apart, this is called the gap. The gap is defined as [n/c] where n is the number of elements and c ... Read More

C++ Program for the Common Divisors of Two Numbers?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 11:22:58

1K+ Views

The common divisor of two numbers are the numbers that are divisors of both of them.For example, The divisors of 12 are 1, 2, 3, 4, 6, 12.The divisors of 18are 1, 2, 3, 6, 9, 18.Thus, the common divisors of 12 and 18 are 1, 2, 3, 6.The greatest ... Read More

10’s Complement of a decimal number?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 09:16:32

2K+ Views

9’s complement and 10’s complement are used to make the arithmetic operations in digital system easier. These are used to make computational operations easier using complement implementation and usually trade hardware usage to the program.To obtain the 9’s complement of any number we have to subtract the number with (10n ... Read More

Average of Squares of n Natural Numbers?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 09:10:15

181 Views

Given a number n, we need to find the average of the square of natural Numbers till n. For this we will first The squares of all the numbers till n. then we will add all these squares and divide them by the number n.Input 3 Output 4.666667Explanation12 + 22 ... Read More

Add 1 to the number represented as array (Recursive Approach)?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 08:59:09

412 Views

Given an array which is a collection of non-negative number represented as an array of digits, add 1 to the number (increment the number represented by the digits ). The digits are stored such that the most significant digit is the first element of the array.To add 1 to the ... Read More

acosh() function for complex number in C++

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 08:47:55

93 Views

The acosh() is the inverse hyperbolic cosine function that returns the inverse hyperbolic cosine of the element passed as parameter. this dysfunction can be out operate over complete. all the it are in radians.To use this method over complex numbers in C plus plus we need to define a template ... Read More

C++ STL asinh() function

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 08:45:48

78 Views

The asinh() function is a function of standard C++ library. The asinh(value) is an inverse hyperbolic sine that returns the value of sinh(x) where x is in radian.The function −asinh() ;Parameter to the function, inverse hyperbolic angle in radian . It can be negative, positive or zero. The parameter value ... Read More

A square matrix as sum of symmetric and skew-symmetric matrix ?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 08:43:39

792 Views

Symmetric Matrix − A matrix whose transpose is equal to the matrix itself. Then it is called a symmetric matrix.Skew-symmetric matrix − A matrix whose transpose is equal to the negative of the matrix, then it is called a skew-symmetric matrix.The sum of symmetric and skew-symmetric matrix is a square ... Read More

Sum of square-sums of first n natural numbers

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 08:41:19

261 Views

The sum of square-sums of the first n natural numbers is finding the sum of sum of squares upto n terms. This series finds the sum of each number upto n, and adds this sums to a sum variable.The sum of square-sum of first 4 natural numbers is −sum = ... Read More

Sum of square of first n odd numbers

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 08:40:00

3K+ Views

The series of squares of first n odd numbers takes squares of of first n odd numbers in series.The series is: 1, 9, 25, 49, 81, 121…The series can also be written as − 12, 32, 52, 72, 92, 112….The sum of this series has a mathematical formula −n(2n+1)(2n-1)/ 3= ... Read More

Advertisements