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

355 Views
In this tutorial, we will be discussing a program to find the sum of the given series (1*1) + (2*2) + (3*3) + (4*4) + (5*5) + … + (n*n).For this, we will be given with the value of n and our task is to add up every term starting from the first one to find the sum of the given series.Example#include using namespace std; //calculating the sum of the series int calc_sum(int n) { int i; int sum = 0; for (i = 1; i

2K+ Views
In this tutorial, we will be discussing a program to find the sum of each row and each column for a given matrix.For this, we will be given with a say A*B matrix. Our task is to traverse through all the elements of the matrix and find the sum of each row and each column of the matrix.Example#include using namespace std; #define m 7 #define n 6 //calculating sum of each row void calc_rsum(int arr[m][n]){ int i,j,sum = 0; for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { sum = sum + arr[i][j]; } cout

2K+ Views
In this tutorial, we will be discussing a program to find the smallest element among the provided three elements.We will be provided with three elements/ integers and our task is to compare them and find the smallest element/ integer among them.Example#include using namespace std; int main() { int a = 45, b = 72, c = 10; if (a

117 Views
In this tutorial, we will be discussing a program to find the side of the octagon inscribed within a given square.For this, we will be given with the side of a square and our task is to find the side of the largest octagon that can be inscribed in it.Finding the relation between the sides of the square and the octagon, we find the formula for the side of the octagonside of square/(√2 + 1)Example#include using namespace std; //calculating the side of the octagon float calc_oside(float a) { if (a < 0) return -1; ... Read More

179 Views
In this tutorial, we will be discussing a program to find the rate percentage from compound interest of the consecutive years.For this, we will be provided with two integers say A and B that are the interests of two consecutive years. Our task is to find the rate of interest for the given values.Finding the relation between the given values and eliminating the principal amount, we get the formula asrate = ((B-A)*100)/AExample#include using namespace std; //calculating the rate of interest float calc_rate(int N1, int N2) { float rate = (N2 - N1) * 100 / float(N1); return ... Read More

250 Views
In this tutorial, we will be discussing a program to find the radius of the incircle of a given triangle.For this, we will be provided with the sides of a particular triangle and our task is to find the radius of the incircle in that triangle.The formula for finding the radius of incircle isarea of the triangle/half perimeter of the triangleExample#include using namespace std; //calculating the radius of incircle float calc_radius(float a, float b, float c) { if (a < 0 || b < 0 || c < 0) return -1; //half perimeter of ... Read More

91 Views
In this tutorial, we will be discussing a program to find the quantity of milk left after mixture replacement.Let us suppose we have X litres of milk. From that, Y litres of milk is replaced with Y litres of water itself. This same procedure is done again and again Z number of times. Our task is to find the final amount of milk left in the container.Finding the relation among the values between the repetitive operations, we find the formula for finding the amount of milk after Z number of operations to beamount left = ((X-Y)/X)Z*XExample#include using namespace std; ... Read More

655 Views
We are given with three arrays where first array contains the upper limit for arithmetic mean, second array contains the lower limit for arithmetic mean and third array contains the frequencies and the task is to generate the arithmetic mean of class intervals given.What is Arithmetic Mean?Arithmetic mean is the average value that is calculated by dividing the sum of all the elements in the set with the total number of elements in the given set.How to calculate Class Interval Arithmetic MeanGiven with Lower Limit, Upper Limit, FrequencyLower LimitUpper LimitFrequency121342563784Calculate the mid-point by adding the upper limit and lower limit ... Read More

4K+ Views
Given with the P number of processes in the memory and N number of needed resources by them to complete their execution and the task is to find the minimum number of resources R which should be allotted to the processes such that deadlock will never occur.What is a DeadlockDeadlock is situation in an operating system where multiple processes residing in the memory doesn’t able to perform their execution because the resources which are needed for program execution is being hold by another resource who is waiting for some other resource for completion.Let’s say there are two processes P1 and ... Read More

557 Views
Given with a positive integer and the task is to generate the odd factors of a number and finding out the sum of given odd factors.ExampleInput-: number = 20 Output-: sum of odd factors is: 6 Input-: number = 18 Output-: sum of odd factors is: 13So, result = 1 + 5 = 6Approach used in the below program is as follows −Input the number for calculating the sum of odd factors of that numberIgnore the digit 0 and 2 because both are even digits and store the digit 1 because it is an odd digitStart the loop from 3 ... Read More