Sunidhi Bansal has Published 1085 Articles

iswprint( ) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 08:18:19

79 Views

We are given with the task to show the working of iswprint( ). The iswprint( ) function in C++ STL is used to check that whether the given wide character can be printed or not. It is a function present in cwctype header file in C++. Wide characters is a ... Read More

Split the sentence into words in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 08:14:52

2K+ Views

Given is the task to split the sentence into words. In this, we will separate all the words present in sentence.Input I am a good boyOutput I am a good boyIn the above example we will print the single word in single line.Example#include #include #include Using namespace std; void split( string st){ ... Read More

sqrt ( ) function for complex number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 08:09:49

553 Views

Given is the task to find the working of sqrt() function for complex number. Basically the sqrt( ) is a function present in complex header file. This function is used to calculate the square root of complex number.Syntaxtemplate complex Sqrt(const complex& x);Parameterx − This parameter x which represent the complex ... Read More

Maximum distance between two occurrences of same element in array in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 08:05:48

2K+ Views

We are given with an array of integers. The array has multiple occurrences of the same elements. The task here is to find the maximum distance between any two same elements of the array. We will pick each element from the array starting from the left. Then we will find ... Read More

Maximum number of characters between any two same character in a string in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 08:02:44

1K+ Views

We are given a string of alphabets. The array can have at least two occurrences of the same character. The task here is to find the maximum number of characters between any two occurrences of a character. If there is no repetition of any character then return -1.Input − string ... Read More

Maximum number of chocolates to be distributed equally among k students in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 08:00:34

1K+ Views

We are given a number of chocolates present in consecutive boxes in the form of an array and a number k which represents the number of students among which these chocolates will be distributed. The task here is to choose consecutive boxes such that the sum of chocolates present in ... Read More

Maximum money that can be withdrawn in two steps in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 07:58:45

235 Views

We are given two lockers, say L1 and L2 that have some amount of money in the form of coins. L1 has A coins and L2 has B number of coins in it. We have to withdraw money or coins from the lockers such that the money drawn out is ... Read More

Maximum difference between the group of k-elements and rest of the array in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 07:56:45

578 Views

We are given with an array of integers of size N and a number k. The array consists of integers in random order. The task is to find the maximum difference between the group of k-elements and rest of the array. The array will be divided into two parts. The ... Read More

Maximum difference between first and last indexes of an element in array in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 07:54:28

568 Views

We are given with an array of integers of size N. The array consists of integers in random order. The task is to find the maximum difference between the first and last indexes of an element in the array. We have to find a number which appears twice in the ... Read More

Maximum difference between two elements such that larger element appears after the smaller number in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 14-Aug-2020 07:52:29

1K+ Views

We are given with an array of integers of size N. The array consists of integers in random order. The task is to find the maximum difference between two elements such that the larger element appears after the smaller number. That is Arr[j]-Arr[i] is maximum such that j>i.Input Arr[] = { ... Read More

Advertisements