Aman Kumar has Published 94 Articles

Print a character n times without using loop, recursion or goto in C++

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:58:12

1K+ Views

In this article, we will see how to print a character n times without using loops and recursion in C++. Input/Output Scenario Let's see following input output scenario − Input : n = 10, c = 'i' Output : iiiiiiiiii Input : n = 5, character = 'j' Output ... Read More

C++ Program to Check if a Point d Lies Inside or Outside a Circle Defined by Points a, b, c in a Plane

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:57:30

290 Views

In this articles, we implements a C++ Program to check if a point d lies inside or outside a circle defined by points a, b, c in a plane using the following equation: s = (x-xt)^2 + (y-yt)^2 – r*r Where equation contains the following points: ... Read More

C++ Program to implement Gift Wrapping Algorithm in Two Dimensions

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:56:07

527 Views

Gift Wrapping AlgorithmThe Gift Wrapping algorithm is also known as Jarvis's march. It is a method for calculating the convex hull of a set of points in a plane. It is essential to find the smallest convex polygon that encloses all the points. Why We Use Gift Wrapping Algorithm? Below ... Read More

C++ Program to Implement Cartesian Tree

Aman Kumar

Aman Kumar

Updated on 16-May-2025 16:54:51

430 Views

Cartesian Tree in C++A Cartesian tree is a binary tree derived from a sequence of distinct numbers. To construct a Cartesian tree, set its root to be the minimum number in the sequence, and then recursively construct its left and right subtrees from the subsequence before and after this number. ... Read More

C++ Program to find Median of Elements where Elements are stored in 2 different arrays

Aman Kumar

Aman Kumar

Updated on 15-May-2025 18:47:19

200 Views

The median is defined as the middle value of a sorted list of numbers, and the middle value is found by ordering the numbers in ascending order. Once the numbers are ordered, the middle value is called the median of the given data set. Here, in this article, we have ... Read More

Calculate range of data types using C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 16:01:08

4K+ Views

Here, we are going to learn how we can calculate the range of the different C++ data types such as signed data types (int, char, float, etc.) and unsigned data types (unsigned char, unsigned int, unsigned float, etc.). Calculating Range of Signed Data Types In C++, signed data types are ... Read More

Difference between std::vector and std::array in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:56:01

23K+ Views

Both vectors and arrays are used to store collections of elements, but they differ significantly in how they manage their memory and flexibility. C++ std::vector A vector is a dynamic array that can be resized automatically when elements are added or removed. It is a part of the C++ STL ... Read More

Why we should avoid using std::endl in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:52:30

728 Views

In this article, we will see why we should avoid the std::endl while printing lines into the console or a file. We use std::endl to create a new line after the current line. For a few lines of I/O operations, it is not causing any problems. However, a large number ... Read More

reference_wrapper in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:45:44

459 Views

std::reference_wrapper is a class template in C++ that allows you to store references to objects or functions in a way that makes them copyable and assignable. Normally, C++ references can't be stored in standard containers like std::vector or std::list, because references are not copyable. std::reference_wrapper solves this problem by internally ... Read More

Calculation in parent and child process using fork() in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:44:05

2K+ Views

The fork() function creates a new process by duplicating the current one. It allows developers to perform parallel tasks and manage resources efficiently. When fork() is called, it returns a value. If the value is greater than 0, then it is in the parent process. Otherwise, it is in the ... Read More

Advertisements