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

174 Views
In this problem, we are given a number N. Our task is to create a program to find N-th term of series 3, 12, 29, 54, 87, … in C++.The series is3, 12, 29, 54, 87, 128, .... N-TermsLet’s take an example to understand the problem, Input − N = 5Output − 87Solution Approach:Let’s deduce the general term of the given series. The series is −3, 12, 29, 54, 87, 128, ....The general term of this series isTn = 4(n2 ) - 3*n + 2Using the general term formula, we can find any value of the series.For example, T8 = ... Read More

111 Views
In this tutorial, we will be discussing a program to find N-th term of series 3, 12, 29, 54, 86, 128, 177, 234, …..For this we will be provided with a number. Our task is to find the term for the given series at that particular position.Example Live Demo#include #include using namespace std; //calculating nth term of given series int nthTerm(int n) { return 4 * pow(n, 2) - 3 * n + 2; } int main() { int N = 4; cout

405 Views
In this problem, we are given a number N. Our task is to create a Program to find N-th term of series 3, 6, 18, 24, … in C++.Problem Description − To find the Nth term of the series −3, 6, 18, 24, 45, 54, 84 … N TermsWe need to find the general formula for the given series.Let’s take an example to understand the problem, Input − N = 10Output − 150Solution Approach:To find the general term of the series, we will first observe the series and check all the possible generalizations of the series. Like, 3 is common ... Read More

121 Views
In this problem, we are given a number N. Our task is to create a Program to find N-th term of series 3 , 5 , 21 , 51 , 95 , … in C++.Problem Description − To find the Nth terms of the series −3, 5, 21, 51, 95, 153, … N-TermsWe need to find the general formula of the series, which is a quadratic equation (based increase in the series).Let’s take an example to understand the problem, Input − N = 6Output − 153Solution Approach:To solve the problem, we will find the general formula for the nth term ... Read More

202 Views
In this problem, we are given a number N. Our task is to create a program to find N-th term of series 2, 4, 3, 4, 15… in C++.Problem Description − To find the sum of the given series, 2, 4, 3, 4, 15, 0, 14, 16 .... N termsWe will find the formula for the general term of the series.Let’s take an example to understand the problem, Input − N = 9Output − 9Solution Approach:The increase of the values in the series is linear i.e. no square values are in the series. Also, it’s value depends on other factors ... Read More

124 Views
In this problem, we are given a number N. Our task is to create a program to find N-th term of series 1 4 15 24 45 60 92... in C++.Problem description − To find the nth term of the series −1, 4, 15, 24, 45, 60, 92, 112 … N termsWe will find the general formula for the series.Let’s take an example to understand the problem, Input − N = 6Output − 60Solution Approach, The general term of the series is based on whether the value of N is even or odd. This type of series is a bit ... Read More

203 Views
We are given a number let’s say num and the task is to calculate the total number of bits changed when 1 is added to a number.Binary representation of a number is done by converting the given number into the form of 0’s and 1’s and it is done by various methods. In one method, we calculate the LCM of a given number by 2 and if a reminder is other than 0 then the bit is set to 1 else it will be set to 0.Addition table for bits are0 + 1 = 1 1 + 0 = 1 ... Read More

514 Views
We are given a number let’s say, num and the task is to calculate the count of binary strings that can be formed through the given number num containing only o’s and 1’s.Binary Number System is one the type of Number Representation techniques. It is most popular and used in digital systems. Binary system is used for representing binary quantities which can be represented by any device that has only two operating states or possible conditions. For example, a switch has only two states: open or close.In the Binary System, there are only two symbols or possible digit values, i.e., ... Read More

1K+ Views
We are given a binary tree and the task is to calculate the count of full nodes available in a binary tree using iterative and recursive approach. Full nodes are those nodes who have both the children and no child is null. Note that in full nodes we consider nodes with exactly two children.Binary Tree is a special data structure used for data storage purposes. A binary tree has a special condition that each node can have a maximum of two children. A binary tree has the benefits of both an ordered array and a linked list as search is ... Read More

450 Views
We are given a binary tree and the task is to calculate the count of half nodes available in a binary tree using iterative and recursive approach. Half nodes are those nodes who have only one child and another child is null. Note that in half nodes we don't consider leaf nodes.Binary Tree is a special data structure used for data storage purposes. A binary tree has a special condition that each node can have a maximum of two children. A binary tree has the benefits of both an ordered array and a linked list as search is as quick ... Read More