Found 27104 Articles for Server Side Programming

Pairs of strings which on concatenating contains each character of “string”

Mallika Gupta
Updated on 31-Jul-2023 17:42:45

30 Views

Introduction A stream of characters flowing together collectively comprising of alphanumeric characters as well as special symbols can be termed as a C++ string. String concatenation is an important aspect of the string data structure, since it is used to combine different sub strings or words to form complete sentences. Concatenation in C++ can be simply done using the + operator. In this article, we are going to develop a code that takes as input an array of string, and then analyses each pair to see if that pair contains all the letters of the word “string” . Let us ... Read More

Print last character of each word in a string

Mallika Gupta
Updated on 31-Jul-2023 17:46:19

731 Views

Introduction C++ strings are essentially a combination of words used as a storage unit to contain alphanumeric data. The words in a string are associated with the following properties − The word positions begin with 0. Every word is associated with a different length. The characters combine together to form words, which eventually form sentences. By default, the words are separated by a space character. Every word contains at least one character. In this article, we are going to develop a code that takes as input a string, and displays the last character of each word in ... Read More

Longest double string of a Palindrome

Mallika Gupta
Updated on 31-Jul-2023 17:39:35

56 Views

Introduction A contiguous sequence of characters, comprising of upper case, lower case, repetitive or unique alphanumeric characters form a C++ string. Every string is recognized by a unique length parameter, which may be odd or even in nature. A palindromic string is the same sequence of characters encountered from both the beginning as well as the end. The characters at equivalent positions from start and end do not differ. They may be even length or odd length palindromes. The odd length palindrome has a middle character separating the two equivalent halves. In this article, we are going to develop a ... Read More

Count of strings satisfying the given conditions

Mallika Gupta
Updated on 31-Jul-2023 17:28:44

66 Views

Introduction A string in C++ is also a primitive data type which is comprised of alphanumeric characters. The letters in a string are case sensitive, but strings can contain both upper and lower case. In this article, we are given an input array of lowercase strings, and require the count of the pair of strings from the array satisfying the following conditions − Both the strings should have the same first and last vowel Both the strings have an equal number of pairs An array is a data structure simulating the storage of similar elements. A C++ array ... Read More

Check if frequency of each character is equal to its position in English Alphabet

Sakshi Koshta
Updated on 31-Jul-2023 17:23:48

151 Views

An integral consideration when examining character frequencies and their place within the English alphabet is determining whether each character's frequency within a string aligns with its corresponding location within the alphabet. Each letter of this 26-letter system holds an assigned position ranging from one through twenty-six. Consequently, we must explore how one can recognize if a character's count in each string correlates with its alphabetical place. The following topic will delve into this issue while exploring whether identifying these frequencies can facilitate validating and investigating connections between character frequency and placement within our beloved language's alphabetical order. Methods Here are ... Read More

How to validate CVV number using Regular Expression?

Sakshi Koshta
Updated on 31-Jul-2023 16:31:14

509 Views

A three- or four-digit number is called the Card Verification Value, or CVV, that is found on the back of most of the credit cards and debit cards as well as on the front of American Express cards. It is also known as CVV2 and CSC (Card Security Code). The CVV code is a security mechanism to ensure that the person making the purchase has a valid card. It was developed to aid in preventing unauthorised transactions. It is typically required when making online purchases over the phone or without a card on hand. Method The following methods are used ... Read More

Encrypt a string by repeating i-th character i times

Mallika Gupta
Updated on 31-Jul-2023 17:36:26

73 Views

Introduction A C++ string is a fixed sequence of alphanumeric characters. It is a continuous stream of occurring characters, which may be digits, characters or even special symbols. Every string is characterized by a definite length. The positions by which the characters are accessed begin with 0. Strings can contain unique or repeated characters concatenated together. They can be subjected to various manipulations and concatenation operations. In this article, we are going to develop a code that takes as input a string, and displays the encrypted string, wherein the first character is repeated 1 time, the second character is ... Read More

Count of buttons pressed in a keypad mobile

Mallika Gupta
Updated on 31-Jul-2023 17:11:33

125 Views

Introduction A string in C++ is an in-built storage structure used to contain digits, characters or even special symbols. Every string is associated with a definite size, specified by its length attribute. By default, the string positions begin with 0. The characters in string can be subjected to various types of manipulations − New characters can be appended at the end of a string. A character can be appended multiple times to the string. In this article, we are going to develop a code that takes as input a string, and counts the number of times the keys ... Read More

Check if the string contains consecutive letters and each letter occurs exactly once

Mallika Gupta
Updated on 31-Jul-2023 17:07:46

857 Views

Introduction A string in C++ is a sequence of characters, which may be distinct or repetitive in nature. Consecutive characters are the characters occurring simultaneously, with a difference of 1. For instance, the characters a and b are consecutive, since they occur together. However, the characters m and o have a difference of 2 in their positions, which make them non-consecutive in nature. In this article, we are going to develop a code that takes as input a string, and displays true in case all the characters in a string are consecutive. Let us look at the following example ... Read More

Character whose frequency is equal to the sum of frequencies of other characters of the given string

Mallika Gupta
Updated on 31-Jul-2023 17:01:46

70 Views

Introduction A C++ string is a stream of alphanumeric characters. A string has the following properties − A string is composed of a fixed set of characters The strings positions start by default from the 0th index Frequency of any character is the number of times it occurs in the string. The frequency of any any character can range from 0 , if it doesn’t occur to the length of the string. In this article, we are going to develop a code that takes as input a string, and checks whether the frequency of any character is equivalent ... Read More

Advertisements