Ayush Gupta has Published 541 Articles

Program to find century for a year in C++

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:17:53

532 Views

In this tutorial, we will be discussing a program to find the century for a year.For this we will be provided with a year. Our task is to find the century in which the given year falls.Example Live Demo#include using namespace std; void find_century(int year){    //year values can only ... Read More

Program to find area of a Circular Segment in C++

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:15:53

170 Views

In this tutorial, we will be discussing a program to find area of a circular segment.Making a chord in a given sphere divides it into two segments - major and minor. Given the radius of the circle and angle making the minor segment, we are required to find the areas ... Read More

partition_point in C++

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:13:33

93 Views

In this tutorial, we will be discussing a program to understand partition_point in C++.Partition point is a method which returns an iterator pointing to the first value in a given range. The range is a partitioned one in which the predicate is not true.Example Live Demo#include #include #include ... Read More

Pair in C++ Standard Template Library (STL)

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:11:55

294 Views

In this tutorial, we will be discussing a program to understand pair in C++ Standard Template Library.Pair is a container defined in the utility header that contains two values. It is used to combine two values and associate them even if they are of different types.Example Live Demo#include #include ... Read More

Override Keyword in C++ programming

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:10:44

165 Views

In this tutorial, we will be discussing a program to understand override keyword in C++.Override keyword is used to override the function in a base class and define a separate function with the same signature in the child class.Example Live Demo#include using namespace std; class Base {    public:   ... Read More

Output Iterators in C++ programming

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:09:22

89 Views

In this tutorial, we will be discussing a program to understand output iterators in C++.Output iterators are a part of the major five iterators. They function opposite of the input iterators in a way that they can be assigned values but can’t be accessed to fetch values.Example Live Demo#include #include using ... Read More

Ordered Set and GNU C++ PBDS

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:07:48

2K+ Views

In this tutorial, we will be discussing a program to understand ordered set and GNU C++ PBDS.Ordered set is a policy based structure other than those in the STL library. The ordered set keeps all the elements in a sorted order and doesn’t allow duplicate values.Example Live Demo#include using namespace ... Read More

Order of Constructor/ Destructor Call in C++

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:04:57

360 Views

In this tutorial, we will be discussing a program to understand the order of constructor/ destructor in C++.Order of constructor/destructor refers to the pattern in which the constructors of various classes are called during inheritance of classes.Example Live Demo#include using namespace std; //parent class class Parent{    public:    Parent(){ ... Read More

Operator overloading in C++ to print contents of vector, map, pair ..

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 12:02:26

470 Views

In this tutorial, we will be discussing a program to understand operator overloading in C++ to print contents of vector, map and pair.Operator overloading is the function of operators which gives them the ability to act on User defined objects and work accordingly in a similar fashion.ExampleVector Live Demo#include #include ... Read More

Merge operations using STL in C++ | merge(), includes(), set_union(), set_intersection(), set_difference(), inplace_merge

Ayush Gupta

Ayush Gupta

Updated on 14-Apr-2020 11:58:44

98 Views

In this tutorial, we will be discussing a program to understand the various merge operations using STL in C++.The merge() function is used to merge two sorted containers in a way that the new container is also sorted. Further includes() is used to check if the elements from first container ... Read More

Advertisements