Ayush Gupta has Published 530 Articles

How to sort a Vector in descending order using STL in C++?

Ayush Gupta

Ayush Gupta

Updated on 21-Feb-2025 16:27:08

595 Views

The problem is to sort a vector in descending order using C++'s Standard Template Library(STL). Sorting in descending order means rearranging the elements of the vector so that the largest elements come first, followed by smaller elements, all the way down to the smallest element at the end of the ... Read More

Create Directory or Folder with C/C++ Program

Ayush Gupta

Ayush Gupta

Updated on 14-Feb-2025 18:05:50

4K+ Views

Creating a folder or directory on your computer is an important task in programming. A directory is like a container that helps store and organize files. In C and C++, you often need to create directories to store data, logs, or configuration files. Creating directories makes file management easier. For ... Read More

File Handling through C++ Classes

Ayush Gupta

Ayush Gupta

Updated on 11-Dec-2024 19:20:31

1K+ Views

In this tutorial, we will be discussing a program to understand File Handling through C++ classes. What's File Handling? File handling is an important concept in programming, which allows a program to read from and write to files. C++ has built-in classes and functions for file handling, which is done ... Read More

Type Inference in C++ (auto and decltype)

Ayush Gupta

Ayush Gupta

Updated on 03-Dec-2024 22:12:18

245 Views

In this tutorial, we will be discussing a program to understand Type interference in C++ (auto and decltype). In the case of auto keyword, the type of the variable is defined from the type of its initializer. Further, with decltype, it lets you extract the type of variable from the ... Read More

In Javascript how to empty an array

Ayush Gupta

Ayush Gupta

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

24K+ 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 the Area and Volume of Icosahedron in C++

Ayush Gupta

Ayush Gupta

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

203 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

653 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 Circumcircle of any regular polygon in C++

Ayush Gupta

Ayush Gupta

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

198 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 bitonic subarray in C++

Ayush Gupta

Ayush Gupta

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

559 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

Maximum sum Bi-tonic Sub-sequence in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 13:56:52

195 Views

In this problem, we are given an array arr[]. Our task is to create a program to find the maximum sum Bi-tonic subsequence in C++.Bi-tonic subsequence is a special sequence whose elements first increase and then decrease.Let’s take an example to understand the problem, Inputarr[] = {4, 2, 3, 7, ... Read More

1 2 3 4 5 ... 53 Next
Advertisements