Ayush Gupta has Published 551 Articles

In Javascript how to empty an array

Ayush Gupta

Ayush Gupta

Updated on 07-Oct-2023 03:16:27

22K+ Views

There are multiple ways to clear/empty an array in JavaScript. You need to use them based on the context. Let us look at each of them. Assume we have an array defined as − let arr = [1, 'test', {}, 123.43]; Substituting with a new array − arr = []; ... Read More

Program to find smallest difference of angles of two parts of a given circle in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:31:19

108 Views

In this problem, we are given an array that denotes the piece of a circle based on the angles of a circle. Our task is to create a program to find smallest difference of angles of two parts of a given circle in C++.Problem Description − We are given the ... Read More

Program to find sum of given sequence in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:28:36

464 Views

In this problem, we are given two numbers n and k for a series. Our task is to create a program to find sum of given sequence in C++.The sequence is −(1*2*3*...*k) + (2*3*...k*(k+1)) + (3*4*...*k*k+1*k+2) + ((n-k+1)*(nk+ 2)*... *(n-k+k).Problem description − Here, we will find the sum of the ... Read More

Program to find sum of series 1 + 2 + 2 + 3 + 3 + 3 + .. + n in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:27:05

287 Views

In this problem, we are given a number n that denotes that nth term of the series. Our task is to create a Program to find sum of series 1 + 2 + 2 + 3 + 3 + 3 + .. + n in C++.Problem description − Here, we ... Read More

Program to find the Area and Volume of Icosahedron in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:24:22

119 Views

In this problem, we are given a value that denotes the side of an icosahedron. Our task is to create a program to find the Area and Volume of Icosahedron in C++.Icosahedron is a regular 30 sided polyhedron. It has 20 equilateral triangles of the same side. There are only ... Read More

Program to find the Area of a Pentagon in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:23:40

358 Views

In this problem, we are given a number n that denotes that side of the pentagon. Our task is to create a program to find the Area of a Pentagon in C++.Pentagon is a five-sided geometric figure.Regular pentagon is a pentagon with all five sides and angles equal.Let’s take an ... Read More

Program to find the common ratio of three numbers in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:23:08

237 Views

In this problem, we are given two ratios i.e. x:y and y:z. Our task is to create a Program to find the common ratio of three numbers in C++.Problem Description − We need to find the common ratio of three numbers using the ratios given to us. Using x:y and ... Read More

Program to find the Circumcircle of any regular polygon in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:22:35

121 Views

In this problem, we are given two numbers that give the number of sides of a polygon N and the length of each side A. Our task is to create a Program to find the Circumcircle of any regular polygon in C++.Problem description − Here, we need to find the ... Read More

Maximum sum and product of the M consecutive digits in a number in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 14:04:03

121 Views

In this problem, we are given a string denoting a number. Our task is to create a program to find the Maximum sum and product of the M consecutive digits in a number in C++.Problem DescriptionWe find all sequences of M consecutive digits. And return the maximum sum and product.Let’s ... Read More

Maximum sum bitonic subarray in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 14:00:02

288 Views

In this problem, we are given an array arr[]. Our task is to create a program to find the maximum sum bitonic subarray in C++.Bitonic Subarray is a special subarray in which the element strictly increase first and then strictly decreases after reaching a certain point.Let’s take an example to ... Read More

1 2 3 4 5 ... 56 Next
Advertisements