## C++ example program to reverse a number

Introduction : In this tutorial, we will learn how to reverse a number in C++ using one loop. We will use one while loop to reverse the number. The program will read the number as input from the user, reverse it and print it to the user.   C++ program Read more…

###### C++

Introduction : Comments are important. It makes the code more readable. Comment is supported in all programming languages. In C++, comments are categorized into two types. In this tutorial, I will show you how to write comments in a C++ program. Always try to write comment in your code. It Read more…

## C++ program to print the ASCII values of all English alphabets

Introduction : In this tutorial, we will learn how to print the ASCII values of all English alphabets in upper case and lower case format. With this program, you will learn how to find out the ASCII value of a character in C++.   Algorithm : We will use two Read more…

## C++ program to find the centroid of a triangle

Introduction : In this C++ programming tutorial, we will learn how to find the centroid of a triangle. The program will take the vertices as input from the user. It will find the centroid and print it out. With this tutorial, you will learn how to read user inputs, how Read more…

## C++ program to print Floyd’s triangle using for and while loop

Introduction : In this C++ tutorial, we will learn how to print Floyd’s triangle programmatically. Floyd triangle is named after Robert Floyd. It is a right angle triangle created by using natural numbers. It looks like as below : 1 2 3 4 5 6 7 8 9 10 11 Read more…

## C++ if-else if-else ladder example

Introduction : An if-else block is used to check a specific condition in C++. We can add one condition in the if block and if this condition is true, it will execute the code written inside the curly braces of the if statement. If the condition is false, it will Read more…

## How to read a string in C++ using getline

Introduction : We can read a string line or a user input line in many ways in C++. In this tutorial, we will show you how to read a line using getline() function. getline() has different variants. We will show you these variants with an example. In C++, you will Read more…