Sudhir sharma has Published 1206 Articles

Sum of squares of binomial coefficients in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 11:05:24

252 Views

The binomial coefficient is a quotation found in a binary theorem which can be arranged in a form of pascal triangle it is a combination of numbers which is equal to nCr where r is selected from a set of n items which shows the following formulanCr=n! / r!(n-r)! or ... Read More

Binary representation of a given number in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 11:02:52

3K+ Views

A binary number is a number that consists of only two digits 0 and 1. For example, 01010111.There are various ways to represent a given number in binary form.Recursive methodThis method is used to represent a number in its binary form using recursion.AlgorithmStep 1 : if number > 1. Follow ... Read More

Balanced Prime in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:59:58

144 Views

Balanced prime number is a prime number that has the same difference for its previous and next prime numbers. i.e. it is the mean of the nearest next prime and previous prime.For a prime number to be a balanced prime, it should follow the following formula −Pn = (P(n-1) + ... Read More

Balance a string after removing extra brackets in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:56:41

143 Views

A string is an array of characters. In this problem, we are given a string which has opening and closing brackets. And we will balance this string by removing extra brackets from the string.Let’s take an example, Input : “)Tutor)ials(p(oin)t(...)” Output : “Tutorials(p(oin)t(...))”To solve this problem, we will traverse through ... Read More

Average of max K numbers in a stream in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:52:36

131 Views

The average of number in a stream means calculating the average after every insertion. But in this problem, we need to find the average of max K numbers in a stream i.e. only k numbers of the array are considered for calculating the average. When we add a number if ... Read More

Average of a stream of numbers in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:48:19

688 Views

Average of numbers is the sum of numbers divided by the total number of numbers.In this problem, we are given a stream of numbers. And we will print average of the number at every point.Let’s take an example of how it works −We have a stream of 5 number 24 ... Read More

Associative arrays in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:44:35

2K+ Views

In c++ programming language, an associative array is a special type of array in which the index value can be of any data type i.e. it can be char, float, string, etc. These associative arrays are also known as maps or dictionaries. Also, the indexes are given a different name ... Read More

Assigning an integer to float and comparison in C/C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:41:40

2K+ Views

The integer is a data type used to define a number that contains all positive, negative or zero non-fractional values. These cannot have decimals.Float is a data type used to define a number that has a fractional value. These can have decimals also.Now, we will check what will be the ... Read More

Assign other value to a variable from two possible values in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:38:34

438 Views

Problem Statementwe have to assign a variable the value of other variables from two possible values without using any conditional operator.DescriptionIn this problem, we are given a variable let's say a which can have a value of any of the two variables x and y. Now, we have to create ... Read More

Array Type Manipulation in C++

sudhir sharma

sudhir sharma

Updated on 24-Oct-2019 10:34:14

2K+ Views

The array is a data structure in c++ that stored multiple data elements of the same data type in continuous memory locations.In c++ programming language, there are inbuilt functions to manipulate array types. Some functions can also be applied to multidimensional arrays. The array header file contains functions to manipulate ... Read More

Advertisements