Category: C++ Code Samples
Count even and odd numbers with while loop in C++
Categories:
C++ Defining a Pointer and changing its value
In this example, we define a pointer and show how to view and change its value.
Categories:
Factorial calculation with C++ do-while loop
In this example, we show how to calculate factorial using the do while loop.
Categories:
C++ Example calculating the factorial of the entered number
In this example, we show how to calculate the factorial of the entered number with the help of a function.
Categories:
C++ adding int and float variables
Categories:
C++ Code example to convert Fahrenheit temperature to Celsius
Categories:
Printing int, float and string values with printf in C++
This code defines a main function where the int and float variables are constants and the text variable is not. Prints the values number, realNumber, and text and then returns 0.
Categories:
C++ 2 string variable concatenation
In this article, we show an example of combining 2 string variables.
Categories:
Combining 2 variables of type char in C++
In this example, you can see how to combine 2 char variables with a length of 50 characters using the strcat method.
Categories:
Finding whether a number is positive or negative with C++
In this example, we check whether the number entered from the keyboard is positive, negative or zero by using if-else if.
Categories:
C++ Nested if statement
Categories:
C++ Cascade if else statement
You can see the usage of cascade if-else statement example below.
Categories:
C++ if else statement
In this article, you can examine the use of C++ if else statement.