Posts by Gagan Gupta

Author Biographical Info: Not available

Remove empty elements from an array in C++

By Gagan Gupta

In this tutorial, we will learn to write the code on how to remove empty elements from an array in C++ programming. CODE #include <bits/stdc++.h> using namespace std; string .... Read More

Check if a given number exists in an array in C++

By Gagan Gupta

In this tutorial, we will learn how to check whether a given number is present in an array in C++. #include<iostream> using namespace std; int main() { int array[6]={1,2,3,4,.... Read More

Pick a random card from a deck of cards in C++

By Gagan Gupta

In this tutorial, we will learn to write code to pick a random card from a deck of cards in c++ #include <iostream> #include <cstdlib> //for rand and srand #include <.... Read More

Print deck of cards in C++

By Gagan Gupta

In this experiment, we will learn how to print the deck of cards in C++ language. #include<iostream> #include<string> using namespace std; int main(){ std::string cards.... Read More

Count the number of Upper cases in a string in C++

By Gagan Gupta

In this tutorial, we will learn to write the code to count all the upper cases alphabets in a string in C++ #include <iostream> using namespace std; int main() { int i; int u.... Read More

How to remove special characters from a string in C++

By Gagan Gupta

In this tutorial, we will learn how to remove special characters from a given string in C++.   #include <iostream> using namespace std; int main() { string str="co//de??.... Read More

Remove specific substring from string in C++

By Gagan Gupta

In this tutorial, we will learn how to remove some specific substring from a given string using inbuilt functions of the string library in the C++ programming language. #include &l.... Read More

How to remove the last character from a string in C++

By Gagan Gupta

In this tutorial, we will learn how to remove the last character from a string in the C++ programing language Remove the last character from a string in C++ #include <string>.... Read More

Related Posts