
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7197 Articles for C++

227 Views
The problem states that we need to figure out the number of ways to choose three points with distance between the most distant points less than or equal to L, a positive integer that will be given as an input. In the problem we will be given an array of different points which lies on the x-axis and an integer L greater than 0. The task involves finding the number of sets of three points where the distance between the most distant points is less than or equal to that integer L. NOTE : The set of points ... Read More

348 Views
The problem includes finding two odd occurring elements in an array where all other elements occur even times in C++. An array is a data structure in C++ which is used to store a list of elements in it of similar data types. We will be given an array of any size greater than or equal to 2 in input. The array will contain integers in it. Every integer in the array will occur even times except two integers which will be occurring odd times in the array. In this problem, we need to find out those two elements ... Read More

304 Views
The problem states that we must determine the sum of the product of r and the rth binomial coefficient (r*nCr). Positive numbers that are coefficients in the binomial theorem are called binomial coefficients. Both Pascal's triangle and a straightforward formula can be used to determine the binomial coefficients. The formula for binomial coefficient is: $$\mathrm{n_{c_{r}}=\frac{n!}{(n-r)!r!}}$$ NOTE : The value of 0! is always equal to 1. In this equation n and r can be any non-negative integers and r should never be greater than n. The objective at hand in this problem entails computing the ... Read More

574 Views
This problem includes that we need to subtract 1 without using arithmetic operators. We will be given any integer N as input in the problem and we need to subtract 1 from the number or simply we need to print N-1. Our task is to perform the operation without using any arithmetic operators. The arithmetic operations involves variety of operations on numbers like addition(+), subtraction(-), multiplication(*), division(/), modulo(%), etc. These operations are supported by every programming language on numbers. Despite using this we need to subtract 1 from the number. For example, Input 7 Output 6 Explanation ... Read More

2K+ Views
We will discuss sorting the vector of Tuple in C++ in ascending order in this article. A list of elements are stored in a C++ data structure known as a tuple. The same or different data types may be contained in it, and we may access them in the same sequence in which they were initialised as inputs. A tuple's data is organised so that we can retrieve it in the same order. Syntax tuple name In C++, this is how we can initialise a tuple. We may require few more tuple functions to sort the vector ... Read More

787 Views
The problem statement includes setting the rightmost unset bit of any positive integer N in C++. A bit is simply a binary digit of any number when represented in the form of a binary number. A binary number is the numerical representation of any data in the form of 0 and 1 where every bit(digit) of the number represents the power of 2 starting with 2^0 from the unit digit. Let's represent an integer 7 in the form of a binary number. The binary representation of 7 will be 111. These numbers can either be represented ... Read More

288 Views
The problem statement says that we need to turn on a particular bit in a number. To put it simply, all we have to do is swap out a certain bit in a number for 1. Provide the same outcome if it has already been 1. You can represent an integer using binary numbers, which come in the forms of 0 and 1 where every digit represents a power of 2. Let's represent 5 in the binary numbers. The binary form of 5 will be 101 i.e.$\mathrm{2^{2} + 2^{0}= 5.}$ In this problem, a number N will ... Read More

311 Views
The Binomial Theorem describes how to expand an expression raised to any finite power. A binomial theorem is a powerful expansion tool that has applications in algebra, probability, and other fields. Assume we have an expression $\mathrm{(x\:+\:y)^n}$and we need to expand the expression, we can do this using the generalised equation of binomial theorem. The binomial theorem defines a binomial expression for two different terms. The general equation of binomial theorem is: $$\mathrm{(a+b)^{n}=^n{C_{r=0}}a^{n-r}b^{0}\:+\:^n{C_{r=1}}a^{n-1}b^{1\:}+\:........\:+\:^n{C_{r=n-1}}a^{1}b^{n-1}+^n{C_{r=n}}a^{0}b^{n}}$$ $$\mathrm{=n_{\sum_{r=0}}^n{C_{r}}a^{n-r}b^{r}}$$ Where we can get the value of $\mathrm{^n{C_{r}}}$ using the formula, $$\mathrm{^n{C_{r}}=\frac{n!}{(n-r)!r!}}$$[0! is always equals to 1] NOTE There ... Read More

383 Views
The problem includes checking if the three given straight lines are concurrent or not. If all three lines in a plane pass through the same point, they are said to be concurrent. They must intersect with each other exactly at one point to be concurrent. The three concurrent lines are depicted in the above illustration. According to the above illustration, the point of intersection of any two lines should be located on the third line to be concurrent. The point of concurrence is the intersection of these lines.As everyone is aware, a straight line can be written as ... Read More

366 Views
In this problem, we need to check whether the given number is an unsigned integer using the DFA. We need to construct the DFA using the 2D array to solve the problem. Problem statement – We have given string str of length N. By constructing the DFA, we need to check whether the str represents the unsigned integer. In the output, print ‘unsinged integer’ or ‘Not an unsinged integer’ according to whether the number is unsinged or not. Sample examples Input– str = "1729" Output– “Unsigned integer.” Explanation– As the number doesn’t contain any sign, it is an ... Read More