Sunidhi Bansal has Published 1085 Articles

Product of maximum in first array and minimum in second in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 08:05:26

311 Views

Given two arrays arr1[] and arr2[] of some size n1 and n2 respectively, we have to find the product of maximum element of first array arr1[] and minimum element of the second array arr2[].Like we have elements in arr1[] = {5, 1, 6, 8, 9} and in arr2[] = {2, ... Read More

Product of factors of number in C++

Sunidhi Bansal

Sunidhi Bansal

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

443 Views

Given a number n we have to find its all factors and find the product of those factors and return the result, i.e, the product of factors of a number. Factors of a number are those numbers which can divide the number completely including 1. Like factors of 6 are ... Read More

Product of first N factorials in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:59:24

377 Views

Given a number N, the task is to find the product of first N factorials modulo by 1000000007. . Factorial implies when we find the product of all the numbers below that number including that number and is denoted by ! (Exclamation sign), For example − 4! = 4x3x2x1 = ... Read More

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

Sunidhi Bansal

Sunidhi Bansal

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

254 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

85 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

141 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

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

793 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

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

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

436 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

Advertisements