Ayush Gupta has Published 530 Articles

Count all subsequences having product less than K in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:17:03

364 Views

In this tutorial, we will be discussing a program to find the number of sub sequences having product less than K.For this we will be provided with non-negative array and a value k. Our task is to find all the subsequences in the array having product less than k.Example Live Demo#include ... Read More

Handling the Divide by Zero Exception in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:14:15

9K+ Views

In this tutorial, we will be discussing how to handle the divide by Zero exception in C++.Division by zero is an undefined entity in mathematics, and we need to handle it properly while programming so that it doesn’t return at error at the user end.Using the runtime_error classExample Live Demo#include ... Read More

How arrays are passed to functions in C/C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:09:38

160 Views

In this tutorial, we will be discussing a program to understand how arrays are passed to functions.In the case of C/C++, the arrays are passed to a function in the form of a pointer which provides the address to the very first element of the array.Example Live Demo#include //passing array ... Read More

Count all possible position that can be reached by Modified Knight in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 12:13:17

114 Views

In this tutorial, we will be discussing a program to find the number of possible positions that can be reached by Modified Knight.For this we will be provided with a 8*8 chessboard. Our task is to find the number of positions Modified Knight can capture with the given number of ... Read More

Count all possible paths from top left to bottom right of a mXn matrix in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 12:08:04

234 Views

In this tutorial, we will be discussing a program to find the number of possible paths from top left to bottom right of a mXn matrix.For this we will be provided with a mXn matrix. Our task is to find all the possible paths from top left to bottom right ... Read More

Count all possible paths between two vertices in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 12:06:13

400 Views

In this tutorial, we will be discussing a program to find the number of paths between two vertices.For this we will be provided with a directed graph. Our task is to find the number of paths possible between two given vertices.Example#include using namespace std; //constructing a directed graph class Graph{ ... Read More

Count all possible N digit numbers that satisfy the given condition in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 12:02:03

188 Views

In this tutorial, we will be discussing a program to find the number of possible N digit numbers that satisfy the given condition.For this we will be provided with an integer. Our task is to check which one of number having N digits followNumber + Reverse(Number) = 10N -1Example#include ... Read More

Count all possible groups of size 2 or 3 that have sum as multiple of 3 in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 11:59:37

232 Views

In this tutorial, we will be discussing a program to find the number of possible groups of size 2 or 3 that have sum as multiple of 3.In this tutorial, we will be discussing a program to find the number of possible groups of size 2 or 3 that have ... Read More

Count all perfect divisors of a number in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 11:44:32

303 Views

In this tutorial, we will be discussing a program to find the number of all perfect divisors of a number.For this we will be provided with a number. Our task is to count all the perfect divisors of that given number.Example#include using namespace std; //checking perfect square bool if_psquare(int n){ ... Read More

Count all Palindromic Subsequence in a given String in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 11:24:43

224 Views

In this tutorial, we will be discussing a program to find the number of all palindromic subsequences in a given string.For this we will be provided with a string. Our task is to find the number of palindromic subsequences that can be made in that given string.Example#include #include using namespace ... Read More

Advertisements