Found 26504 Articles for Server Side Programming

iswlower() function in C++ STL

Sunidhi Bansal
Updated on 27-Feb-2020 05:35:46

135 Views

In C++ standard template library(STL), iswlower() function is used to check if the given wide character is in lowercase or not, if not then the function will return a zero value. The characters with ASCII value from 97 to 122 i.e. a-z are the lowercase alphabetic letters. Iswlower() function is present in cctype header file in C/C++.Syntax of iswlower () is as followsint iswlower (wint_t c)Parameters − c is a wide character to be checked, casted to a wint_t, or WEOF where wint_t is an integral type.Return Value − islower() function return non-zero value when the string is in lowercase ... Read More

iswdigit() function in C++ STL

Sunidhi Bansal
Updated on 30-Jan-2020 09:44:13

146 Views

In C++ STL, iswdigit() function is a built-in function that is used to check if the given wide character is a decimal digit character or some other character. This function is present in a cwctype header file in C/C++.What are the decimal digit characters?Decimal digit character are the numeric values that starts from 0 i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 .Syntax of iswcntrl() function is as followsint iswdigit() (wint_t c)Parameters − c is a wide character to be checked, casted to a wint_t, or WEOF where wint_t is an integral type.Return Value − A value ... Read More

iswcntrl() function in C++ STL

Sunidhi Bansal
Updated on 30-Jan-2020 09:59:01

151 Views

The iswcntrl () function in C++ standard template library(STL) is used to check if the given wide character is a control character or not. A control character is a character in C/C++ that won’t occupy a printing position on a display screen. Iswcntrl() function is defined in a cwctype header file.Syntax of iswcntrl() function is as followsint iswcntrl (wint_t c)Parameters − c − This is the character to be checked.Return Value − A value different from zero (i.e.. a non-zero value) if c is a control character else a zero value.Approach used in the below program is as followsInput the ... Read More

Letter Combinations of a Phone Number in Python

Arnab Chakraborty
Updated on 27-Apr-2020 12:16:20

3K+ Views

Suppose we have a string containing digits from 2-9 inclusive. We have to return all possible letter combinations that the number could represent. One mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.12a b c3d e f4g h i5j k l6m n o7p q r s8t u v9w x y z*0#For an example, if the given string is “23”, then the possible strings will be [“ad”, “ae”, “af”, “bd”, “be”, “bf”, “cd”, “ce”, “cf”]To solve this, we will follow these steps −Define an array called solve ... Read More

3Sum Closest in C++

Aman Kumar
Updated on 29-Jul-2025 15:18:00

1K+ Views

The 3 Sum Closest problem involves finding the sum of three numbers in an array that is closest to a given target value. We are given an integer array nums of length n and an integer target. Our goal is to find three integers in the array such that their sum is as close as possible to the target using C++ program. In this task, we assume that each input has exactly one solution. If there are multiple sums equally close to the target, we return the maximum one. Let's consider the following example scenario to understand the problem more ... Read More

3Sum in Python

Arnab Chakraborty
Updated on 27-Apr-2020 12:04:31

6K+ Views

Suppose we have an array of numbers. It stores n integers, there are there elements a, b, c in the array, such that a + b + c = 0. Find all unique triplets in the array which satisfies the situation. So if the array is like [-1, 0, 1, 2, -1, -4], then the result will be [[-1, 1, 0], [-1, -1, 2]]To solve this, we will follow these steps −Sort the array nums, and define an array resfor i in range 0 to length of nums – 3if i > 0 and nums[i] = nums[i - 1], then ... Read More

Integer to Roman in C

Arnab Chakraborty
Updated on 27-Apr-2020 11:57:00

7K+ Views

Given a decimal number n, we have to convert this into Roman numeral. The value n lies in the range 1 to 4000. These are some Roman Numerals.NumberNumeral1I4IV5V9IX10X40XL50L90XC100C400CD500D900CM1000M4000MMMMSo if the number n = 859, its Roman Numeral will be DCCCLIXTo solve this, we will follow these stepsDefine an array to store numeral and corresponding values for the given list. That is called nume arraywe are using a recursive approach, the function decToRom() is used. this is taking nume array and the number num.The decToRom() will be likeif num is not 0, thenmax := find maximum value from nume array that ... Read More

Container With Most Water in Python

Arnab Chakraborty
Updated on 27-Apr-2020 11:38:14

432 Views

Suppose we have a set of n non-negative integers a1, a2, ..., an, each value represents a point at coordinate (i, a[i]). n vertical lines are present in such a way that the two endpoints of line i is at (i, a[i]) and (i, a[0]). We have to find two lines, which together with x-axis forms one container, so our goal is to find two columns where water volume is max. So if the array is like [1, 8, 6, 2, 5, 4, 8, 3, 7], then it will beIn the shaded part, the height is 7 and there are ... Read More

iswblank() function in C++ STL

Sunidhi Bansal
Updated on 27-Feb-2020 05:44:24

139 Views

The iswblank () function in C++ is used to check if the given wide character is blank not. It is present in “ctype.h” header file in C language and “cctype” header file in C++ Standard template library (STL).Syntax of iswblank is as followsint iswblank(wint_t ch)Return Type − returns non zero value if it contains blank spaces and value 0 if it doesn’t.Parameters − ch − This is the character to be checked.ExampleInput − string str = “I Love Myself”Output − total number of spaces is − 2Input − string str = “Myself”Output − total number of spaces is − 0Approach used ... Read More

Declare a C/C++ function returning pointer to array of integer function pointers

Sunidhi Bansal
Updated on 27-Feb-2020 05:41:36

466 Views

With given array the task is to create a function which will return pointer to an array of integer function pointers.For that we will input the two values and call a function which compares both the two values and functions pointer which return the memory address of bigger value and print it as a result. The function pointer is used to pass address of different function at different times thus making the function more flexible and abstract. So function pointers can be used to simplify code by providing a simple way to select a function to execute based on run-time ... Read More

Advertisements