Sunidhi Bansal has Published 1100 Articles

Printing string in plus ‘+’ pattern in the matrix in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:58:02

184 Views

Given a string str, we have to print the given string str in ‘+’ pattern in the matrix. To form plus pattern in a matrix the matrix must be a square matrix. A square matrix is that matrix which has same number of rows and column.Like we have a string ... Read More

Program for centered nonagonal number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:45:04

51 Views

Given with a value ‘n’ and the task is to generate the centered nonagonal number for n and centered nonagonal series till n and display the results.What is centered nonagonal number?Centered nonagonal number contains the nonagonal layers formed by the dots and one corresponding dot in the center.Given above is ... Read More

Program for Centered Icosahedral Number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:42:50

83 Views

Given with a value ‘n’ and the task is to generate the centered Icosahedral number for n and centered Icosahedral series till n and display the results.What is centered Icosahedral number?Centered Icosahedral number is a centered number used for representing an icosahedrons(it is a polyhedron figure with 20 faces).The first ... Read More

Program for Mean and median of an unsorted array in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:40:09

12K+ Views

Given with an array of an unsorted array and the task is to calculate the mean and median of an unsorted array.For calculating the meanMean is calculated for finding out the average. We can use the given formula to find out the meanMean = (sum of all the elements of ... Read More

Program for Mean Absolute Deviation in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:38:04

621 Views

Given with an array of natural numbers and the task is to calculate the mean absolute deviation and for that we must require the knowledge of mean, variance and standard deviation.There are steps that need to be followed for calculating the mean absolute deviationCalculate the meanCalculate absolute deviationAdd all the ... Read More

Program for harmonic mean of numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:33:54

833 Views

Given with an array of natural numbers and the task is to calculate the harmonic mean of given numbers and print it.What is harmonic mean?Harmonic mean means the reciprocal of the arithmetic mean by their reciprocals.$$Harmonic\: Mean=\frac{n}{\frac{1}{a}+\frac{1}{b}+\frac{1}{c}+...}$$Where, n is the total number of elements given and a, b, c, .. ... Read More

Program for cube sum of first n natural numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:31:58

545 Views

Given an integer n, the task is to find the sum of the cube of first n natural numbers. So, we have to cube n natural numbers and sum their results.For every n the result should be 1^3 + 2^3 + 3^3 + …. + n^3. Like we have n ... Read More

Product of all the elements in an array divisible by a given number K in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:29:56

351 Views

Given an array arr[n] with n number of integers and another integer k, the task is to find the product all the elements of arr[] which are divisible by k.To solve the problem we have to iterate every element of the array and find whether it is completely divisible by ... Read More

Product of all the Composite Numbers in an array in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:28:02

176 Views

Given an array arr[n] of n number of integers, the task is to find the product of all composite numbers in an array.Composite numbers are the whole numbers which are made by multiplying 2 other whole numbers. For example 6 is a composite number which can be made by multiplying ... Read More

Product of all pairwise consecutive elements in an Arrays in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:25:21

269 Views

Given an array arr[n] of n number of integers, the task is to find the product of all pairwise consecutive elements.Consecutive elements in an array arr[] are, if we are at ith element, i.e. arr[i] then its consecutive element will be either arr[i+1] or arr[i-1], so the product will be ... Read More

Advertisements