
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++

483 Views
In this problem, we are given a string num which is a large number. Our task is to create a program to find remainder when large number is divided by 11 in C++.Problem Description − We need to find the remainder when the number defined by the string is divided by 11.Let’s take an example to understand the problemInputnum = “43212981843718452”Output7Solution ApproachTo find the remainder, we obviously need to divide the number. But dividing huge number is a complex process so to ease up the process, we will divide digit by digit. And store the remainder that follows. This process ... Read More

318 Views
In this tutorial, we will be discussing a program to find prime numbers between given intervals.For this we would be provided with two integers. Our task is to find the prime numbers in that particular range.Example Live Demo#include using namespace std; int main() { int a, b, i, j, flag; //getting lower range a = 3; //getting upper range b = 12; cout

511 Views
In this problem, we are given the side of a square (A) and the length and breadth of a rectangle (L and B). Our task is to create a Program to find Perimeter / Circumference of Square and Rectangle in C++.Problem Description:To find the circumference of a square, we need the side of the square (a). For that, we will use the formula for the perimeter of the square which is 4a.To find the circumference of a rectangle, we need the Length (L) and breadth (B) of the rectangle. For that, we will use the formula for the perimeter of ... Read More

415 Views
In this tutorial, we will be discussing a program to find parity.For this we will be provided with a number. Our task is to find its parity i.e count of whether the number of ones are odd or even.Example Live Demo# include # define bool int using namespace std; //finding the parity of given number bool getParity(unsigned int n) { bool parity = 0; while (n){ parity = !parity; n = n & (n - 1); } return parity; } int main() { unsigned int n = 7; cout

914 Views
In this problem, we are given input from the user. Our task is to create a program to find out the data type of user input in C++.Problem Description − We will take input from the user and check the data type of the input value.Let’s take an example to understand the problem, Example 1:Input − 34Output − It is an integerExample 2:Input − tutorialspointOutput − It is a stringSolution Approach:We will check if the input string is a number or not a number.If it is a number, we will check if it is an integer or a float value.If ... Read More

2K+ Views
In this problem, we are given the size of a chessboard. Our task is to create a program to find number of squares in a chessboard in C++.Problem Description − To find the number of squares in a chessboard. We will have to calculate all the combinations of the square that are inside the chessboard i.e. we will consider squares of side 1x1, 2x2, 3x3 … nxn.Let’s take an example to understand the problem, Input: n = 4.Output: 30Squares of size 1x1 -> 16 Squares of size 2x2 -> 9 Squares of size 3x3 -> 4 Squares of size 4x4 ... Read More

343 Views
In this problem, we are given a quadratic equation of type ax2 + bx + c, where a, b and c are constants. Our task is to create a program to find number of solutions in Quadratic Equation in C++.Problem Description − Here, we need to find the numbers of solutions for a quadratic equation that can have at max 2 solutions.Let’s take a few examples to understand the problem, Example 1:Input − 3x2 + 7x + 4Output − 2Explanation − the two solutions of the equation are 1 and 4/3.Example 2:Input − x2 - 4x + 4Output − 1Explanation ... Read More

262 Views
In this problem, we are given an integer n that denotes the nth term of the series. Our task is to create a program to find N-th term of series 9, 23, 45, 75, 113… in C++.Problem Description − Here, we need to find the nth term of the series for which we will be finding the general term of the series.The series is 9, 23, 45, 75, 113, 159, 213, …Let’s take an example to understand the problem, Input − n = 5output − 159Solution Approach, The general term of the given series isNth term = ( ((2*N + ... Read More

110 Views
In this problem, we are given a number n that denotes the nth term of the series. Our task is to create a program to find the N-th term of series 7, 21, 49, 91, 147, 217, …… in C++.Problem Description - We will find the nth term of the series 7, 21, 49, 91, 147, 217, … and for that, we will deduce the general term of the series.Let’s take an example to understand the problem, Input − N = 5Output − 147Solution Approach:Let’s deduce the general term of the given series. The series is −7, 21, 49, 91, ... Read More

601 Views
In this problem, we are given a number N. Our task is to create a program to find N-th term of series 4, 14, 28, 46, 68, 94, 124, 158, …..in C++.Problem Description − To find the Nth term of series4, 14, 28, 46, 68, 94, 124, … (N-terms), We will find the general term of the series and calculate the value based on the value of n.Let’s take an example to understand the problem, Input − N = 5Output − 68Solution Approach:Let’s deduce the general term of the given series. The series is:4, 14, 28, 46, 68, 94, 124….We ... Read More