Ayush Gupta has Published 530 Articles

Program to find compound interest in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 11:17:09

405 Views

In this tutorial, we will be discussing a program to find compound interest.Compound interest is the interest by adding the current interest to the principal sum and then calculating the interest on the updated amount.Example Live Demo#include using namespace std; int main(){    double principle = 10000, rate = 10.25, ... Read More

Queries for maximum difference between prime numbers in given ranges in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:50:10

401 Views

In this problem, we are given Q queries that consist of two values L and R. Our task is to create a program to solve Queries for maximum difference between prime numbers in given ranges in C++.Problem description: Here, in each querry, we are given two values L and R. ... Read More

Queries for decimal values of subarrays of a binary array in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:48:03

106 Views

In this problem, we are given a binary array bin[] and Q queries each consists of two values L and R. Our task is to create a program to solve queries for decimal values of subarrays of a binary array in C++.Problem description − Here to solve each query, we ... Read More

Queries for frequencies of characters in substrings in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:46:24

178 Views

In this problem, we are given a string. And Q queries each has two integers l and r and character ch. our task is to create a program to solve the queries for frequencies of characters in substrings in C++.Problem description: Here for each querry, we will find the frequency ... Read More

Queries for number of distinct elements in a subarray in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:44:10

193 Views

In this problem, we are given an array arr[] of size n. And Q queries, each consisting of two elements l and r. Our task is to create a program to solve Queries for number of distinct elements in a subarray in C++.Problem description − Here for each querry, we ... Read More

Queries for number of distinct elements in a subarray | Set 2 in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:43:19

440 Views

In this problem, we are given an array arr[] of size n and we are given a query. Each query contains two values (L, R). our task is to create a program to solve queries for number of distinct elements in a subarrayProblem description − Here, we will need to ... Read More

Queries on sum of odd number digit sums of all the factors of a number in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:42:01

176 Views

In this program, we are given Q queries, each query has a positive integer N. Our task is to create a program to solve queries on sum of odd number digit sums of all the factors of a number in C++.Problem description − To solve each query, we need to ... Read More

Queries for number of distinct integers in Suffix in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:40:33

124 Views

In this problem, we are given an array of N integers. There are Q queries, each containing an integer value m. Our task to create a program to solve Queries for number of distinct integers in Suffix in C++.Problem description − Here, we will need to find the total number ... Read More

Queries on insertion of an element in a Bitonic Sequence in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:39:38

123 Views

In this problem, we are given a bitonic Sequence and Q queries. Each query has an integer x. Our task is to print the length of the bitonic sequence after inserting integers after each query. And at the end print the bitonic sequence.Problem description − Here, we are given a ... Read More

Queries on count of points lie inside a circle in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:38:06

648 Views

In this problem, we are given n points that lie of a 2D plane, each coordinate is (x, y). Our task is two solve queries. For each query, we are given an integer R. We need to find the count of points lying inside the circle, taking the circle’s center ... Read More

Advertisements