In this example we show how to concatenate 2 strings in C++ We will use the + operator to join 2 strings from the user Example #include <iostream> using …
-
-
In this example we will check if a number is positive or negative in C++ Example We use an if -else statement in this example after taking input from the …
-
In this example we show you how to copy one string to another in C++ Example #include <iostream> using namespace std; int main() { string myString1, myString2; cout << …
-
In this example, we will show you how to open and read the contents of a file, in C++. Example In this example we open a file called fileexample.txt The …
-
In this example we show how to tell if a number is a prime number or not in C++ Lets first talk about what a prime number is A prime …
-
In this article we show you how to check if a number is even or odd in C++ We use the modulus operation which returns the remainder obtained when number …
-
In this article we show a simple way to convert a decimal number to a binary number using JavaScript Example 1 The user is prompted to enter a number. The …
-
In this example we display all the prime numbers between 1 and 100. A prime number is a positive integer that is only divisible by 1 and itself Example // …
-
In this example we check if a year is a leap year Some examples use a formula to check if a year is a leap year, this example checks if …
-
In this example we will display the current date and time in JavaScript Example 1 // get local machine date time const date = new Date(); // get the date …
-
In this example we will check that two strings match You will see that the pattern below has the following gi, this means Flags Description g Performs a global match …
-
In this example we will compare 2 strings to see if they are a match Example 1 First of all we convert the strings to lowercase using .toLowerCase() method, you …