Pangram string program in C++ English has a total of 26 alphabets. If a string comprises all the English alphabets in it then it is called a pangram . A pangram is a popular program in interviews. This program can be executed in several ways but I will use a simple and easy-to-understand approach here. Code: #include <bits/stdc++.h> using namespace s…
Read moreProgram to Convert first character uppercase in a String Code #include <bits/stdc++.h> using namespace std; char lower(char c){ // to check & convert uppercase to lowercase if(c>=65 && c<=90){ return c+32; } else{ return c; } } char upper(char c){ //to check & conv…
Read more//Program to convert uppercase alphabet lowercase and lowercase alphabet to uppercase in a string #include <bits/stdc++.h> using namespace std; int main() { string s; //requesting string cin>>s; int l=s.length(); …
Read more//Program to print the no. of LOWERCASE, UPPERCASE, NUMBERS, SPACES & SYMBOLS in a String #include <bits/stdc++.h> using namespace std; int main() { string s; //requesting string cin>>s; int l=s.length(); …
Read more//Program to Count no of Occurrences of a Character in a String #include <bits/stdc++.h> using namespace std; int main() { cout<< "Enter a String: " ; //requesting a string string s; getline(cin,s); //to read space separated input cout<< "\nEnter a character: …
Read moreProgram to count no words in a given string Code #include <bits/stdc++.h> using namespace std; int main() { cout<< "Enter a String: " <<endl; //requesting a string string s; getline(cin,s); //to read space separated input int count=1;…
Read moreReverse function in C++: C++ has a built in function to reverse the order of given input. It reverses the order of the elements in the range (first, last) of any input. The time complexity of reverse() is O(n). Program to reverse a given string in C++ #include <bits/stdc++.h> using namespace std; int main() { cout<< "Enter a String: " …
Read moreProgram to check given string is Palindrome or not in C++ Code #include <bits/stdc++.h> using namespace std; int main() { string s; cout<< "Enter a string" <<endl; //Requesting String cin>>s; string t=s; //Sto…
Read moreProgram to count and print the number of vowels(a, e, i, o, u) in a given string This code can be simply executed with an if-else ladder. To know about the ladder statement in C++ read the if-else ladder in C++. Take the string from the user, calculate the length of the string. Initiate a loop from zero to the size of the string and check each e…
Read moreNote: The string can also be reversed using reverse function. Program to print length of string, print the string in reverse and check the string is palindrome or not Take the input string from the user, calculate and print the length of the string. Reverse and print the string. Compare the reversed string with the original string and check if they are the …
Read moreIn this program we will replace the Email id provided by user with Asterisk (Star "*"). Only the First letter, the letter after "@" and ".com" will be visible. This is one of the most commonly asked interview program. Program to replace Email with Asterisk "*" Logic : Store special Characters "@" and "."…
Read morePalindrome Number / String Palindrome : A sequence is called palindrome when it reads same backwards as forwards. While checking for a palindrome number or sequence we check whether the first number matches with last, second number matches with the number second from last and so on. Remember the middle entity will be unique tha…
Read moreCopyright © 2021 Coding Demons All Rights Reseved
Social Plugin