C++ Program to Find the Length of a String

This is a C++ Program to Find the Length of a String/Array. Problem Description The program takes a string or an array and prints its length. Problem Solution 1. The program takes a string or an array. 2. Using inbuilt function, the length of the string is found. 3. The result is printed. 4. Exit. … Read more

advertisement

C++ Program to Find the GCD and LCM of N Numbers

This is a C++ Program to find GCD and LCM of given two numbers. Here is source code of the C++ Program to Find the GCD and LCM of n Numbers. The C++ program is successfully compiled and run on a Linux system. The program output is also shown below. #include<iostream>#include<conio.h>#include<stdlib.h> using namespace std; int gcd(int x, … Read more

advertisement

C++ Program to Print All Permutations of a Given String

Method 1: Print all permutations of a given string This C++ Program Permute All Letters of an Input String. It iterates from the 0th letter to the last letter in a string, swaps values and recursively call permute function to print values. The program has input as a string. This prints permutation of all letters … Read more

advertisement

C++ Program to Find the Length of Longest Common Substring

This C++ Program finds Length of Longest Common Substring. Here is source code of the C++ Program to Find Length of Longest Common Substring. The C++ program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C++ Program to Find Length of Longest Common Substring */#include<iostream>#include<cstring>using namespace std; // … Read more

advertisement

String Concatenation in C++

What is String concatenation? String concatenation in C++ is the process of combining multiple strings into a single string. It involves merging the characters or contents of two or more strings to create a new concatenated string. For Example, first string = Hello; second string = World Hello + World = Hello World Problem Description … Read more

advertisement

C# Program to Convert Characters of a String to Opposite Case

This C++ Program which changes the case of the given alphabetical character. The program takes a character as an input and exits if the given character is not an alphabet. The case of the given alphabet is changed on the basis of whether the case of given alphabet is lowercase or uppercase. Here is source … Read more

advertisement

C++ Program to Demonstrate the use of String Class

This C++ Program which demonstrates the use of string class. The program uses a special header for using string class. A ‘string’ object is created, the name of the user is taken as input to save it into the string object, the length of string object is printed and also the string object is printed … Read more

advertisement

C++ Program to Remove Specific Character from the String

This C++ Program which removes a given character from the string. The program takes a string and the character to be removed as the input, uses standard library remove( ) algorithm for returning a range of elements with all the elements equal to the character removed which when passed to the standard library algorithm erase( … Read more

advertisement

C++ Program to Check if a String is Palindrome

This is a C++ Program to Find if a String is Palindrome. Problem Description The program checks if a string is a palindrome or not. A palindrome is a word or a string that reads the same backward and forward. Problem Solution 1. The program takes a string and stores it. 2. The string is … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.