Sudhir sharma has Published 1206 Articles

beta(), betaf() and betal() functions in C++ STL

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 12:05:24

196 Views

The functions beta(), betaf() and betal() are built-in functions in the standard template library of C++. These functions are used to calculate the beta function of two positive real numbers.The functions beta(), betaf() and betal() are built-in functions in the standard template library of C++. These functions are used to ... Read More

Bertrand's Postulate in C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 12:00:29

99 Views

Bertrand’s postulates is a mathematical showroom which states that for every number n>3, there exists a prime number p which lies between n and 2n-2.The formula for Bertrand's Postulaten < p < 2n -2Where n is a number such that n>3 and p is a prime number.Prime number − A ... Read More

Berkeley’s Algorithm in C/C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:56:44

1K+ Views

Berkeley’s Algorithm is an algorithm that is used for clock Synchronisation in distributed systems. This algorithm is used in cases when some or all systems of the distributed network have one of these issues −A. The machine does not have an accurate time source.B. The network or machine does not ... Read More

Bayes Theorem for Conditional Probability in C/C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:54:29

577 Views

Conditional probability denoted by P(A|B) is the probability of occurrence of an event ‘A’ given that event ‘B’ has already occurred.Formula for conditional probability −P(A|B) = P( A⋂B ) / P(B)Bayes’s TheoremIt is the formula that shows the relation between probabilities of occurrences of mutually dependent events i.e. it given ... Read More

Basics of File Handling in C Programming

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:48:45

20K+ Views

File Handling is the storing of data in a file using a program. In C programming language, the programs store results, and other data of the program to a file using file handling in C. Also, we can extract/fetch data from a file to work with it in the program.The ... Read More

attributes in C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:39:44

3K+ Views

Attributes are modern ways in C++ to standardize things if their code runs on different compilers. Attributes are used to provide some extra information that is used to enforce conditions (constraints), optimization and do specific code generation if required.These are like an information manual for the compilers to do some ... Read More

Ways to multiply n elements with an associative operation in C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:35:40

74 Views

In this problem, we are given an integer n which is the number of elements. Our task is to create a program that counts the number of ways to multiply n elements with the associative operation.Associative operations return the same result irrespective of the manner the numbers are arranged.Let’s take ... Read More

Ways to paint N paintings such that adjacent paintings don’t have same colors in C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:32:40

145 Views

In this problem, we are given two integers n and m, where n is the number of paintings and m is the number of colors available. Our task is to create a program that will find the total number of ways in which we can paint the paintings in such ... Read More

Ways to paint stairs with two colors such that two adjacent are not yellow in C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:30:06

106 Views

We are given n stairs and 2 colors (red and yellow) with which these stairs are to be painted. Our task is to count the number of ways in which we can paint the stairs such that no two consecutive steps will be yellow-colored.Let’s take an example to understand the ... Read More

Ways to place items in n^2 positions such that no row/column contains more than one in C++

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 11:27:40

54 Views

In this problem, we are given an integer n such that there are n lines vertically and n horizontally that are placed such that there are n2 intersection between these lines. Our task is to find the total number of ways by which 4 items can be placed on these ... Read More

Advertisements