Sudhir sharma has Published 1082 Articles

Maximum product of an increasing subsequence of size 3 in C++ program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 12:07:55

216 Views

In this problem, we are given an array arr[] of n positive integers. Our task is to create a program to find the Maximum product of an increasing subsequence of size 3.Problem Description − Here, we need to find the maximum product of 3 elements of the array such that ... Read More

Maximum product of a triplet (subsequence of size 3) in array in C++ Program.

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 12:04:27

776 Views

In this problem, we are given an array arr[] consisting of n integers. Our task is to find the maximum product of a triplet (subsequence of size 3) in array. Here, we will be finding the triple with maximum product value and then return the product.Let’s take an example to ... Read More

Sum of two numbers where one number is represented as array of digits in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 10:43:45

200 Views

In this problem, we are given two numbers, from which one is represented using array of digits. Our task is to create a program that will find the sum of two numbers where one number is represented as array of digits.Let’s take an example to understand the problem, Input: n ... Read More

Sum of two large numbers in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 10:40:28

5K+ Views

In this problem, we are given two string that defines two large numbers. Our task is to create a program to find the sum of two large numbers.Let’s take an example to understand the problem, Input: number1 = “341299123919” number2 = “52413424” Output: 341351537343To solve this problem, we will traverse ... Read More

Sum of the series Kn + ( K(n-1) * (K-1)1 ) + ( K(n-2) * (K-1)2 ) + ... (K-1)n in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 10:22:15

363 Views

In the problem, we are ginen two number k and n of the series K^n + ( K^(n-1) * (K-1)^1 ) + ( K^(n-2) * (K-1)^2 ) + ... (K-1)^n. Our task is to create a program to find the sum of the series.Let’s take an example to understand the ... Read More

Sum of XOR of all subarrays in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 10:14:33

1K+ Views

In this problem, we are given an array arr[] of n numbers. Our task is to create a program to find the sum of XOR of all subarrays of the array.Here, we need to find all sub-arrays of the given array, and then for each subarray, we will find the ... Read More

Sum of XOR of all possible subsets in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 10:00:52

461 Views

In this problem, we are given an array aar[] of n numbers. Our task is to create a program to find the Sum of XOR of all possible subsets.Here, we will find all subsets of the array. Then for each subset, we will find the XOR of elements of the ... Read More

Sum of XOR of all pairs in an array in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 09:58:43

2K+ Views

In this problem, we are given an array arr[] of n integers. Our task is to create a program to find the sum of XOR of all pairs in an array.Let’s take an example to understand the problem, Input: arr[] = {5, 1, 4} Output: 10 Explanation: the sum of ... Read More

Sum of upper triangle and lower triangle in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 09:49:49

1K+ Views

In this problem, we are given a matrix. Our task is to create a program to print the sum of upper triangle and lower triangle.Lower triangleM00                     0             0       …       ... Read More

Sum of two numbers modulo M in C++

sudhir sharma

sudhir sharma

Updated on 17-Aug-2020 09:40:20

651 Views

In this problem, we are given three numbers a, b, and M. our task is to create a program to find the sum of two numbers modulo M.Let’s take an example to understand the problem, Input: a = 14 , b = 54, m = 7 Output: 5 Explanation: 14 ... Read More

Advertisements