# Category Archives: C++ Programs

The imag() function is defined in the complex header file. The imag() function is used to find the imaginary part of the complex number. Syntax:â€¦ Read More
The real() function is defined in the complex header file. The real() function is used to find the real part of the complex number. Syntax:â€¦ Read More
Cycle:- cycle is a path of edges and vertices wherein a vertex is reachable from itself. or in other words, it is a Closed walk. â€¦ Read More
Given four types of variables, namely int, char, float and double, the task is to write a program in C++ to find the size ofâ€¦ Read More
Given n, we need to find sum of first n terms of the series represented as Sn = 3 + 5 + 9 + 17â€¦ Read More
Given an array of N distinct elements, find the minimum number of swaps required to sort the array. Note: The problem is not asking toâ€¦ Read More
Given a series:   Sn = 1*3 + 3*5 + 5*7 + …  It is required to find the sum of first n terms of thisâ€¦ Read More
Given the Length and Speed of the train and the time takes by the train to passes the bridge or tunnel, the task is toâ€¦ Read More
Given N, the number of persons. The task is to arrange N person around a circular table.Examples:   Input: N = 4 Output: 6 Input: Nâ€¦ Read More
Problem Statement: Write a C++ program to create a file using file handling and check whether the file is created successfully or not. If aâ€¦ Read More
The nearbyint() function is defined in cmath header file. This function round off the given value to a nearby integral value by using the currentâ€¦ Read More
Given two numbers and . The task is to find the sum of the sequence given below.  (1*2*3*…*k) + (2*3*…*k*(k+1)) + (3*4*..*(k+1)*(k+2)) +…..+((n-k+1)*(n-k+2)*…*(n-k+k)). Since the output canâ€¦ Read More
Given two integers L and B denoting the length and breadth of a rectangle respectively. The task is to calculate the sum of the areaâ€¦ Read More
Given a number N. The task is to write a program to find the Nth term in the below series:   5, 13, 25, 41, 61...â€¦ Read More
Given a number N. The task is to write a program to find the Nth term in the below series:   1, 1, 2, 6, 24…â€¦ Read More