Skip to content

Category Archives: C++ Programs

Integers in C++ are allocated with a certain number of bits. If an integer value, takes more bits than the allocated number of bits, then… Read More
In this article, we will learn how to convert int to char in C++. For this conversion, there are 5 ways as follows: Using typecasting.… Read More
In this article, we will learn how to convert strings to double in C++. For this conversion, there are 3 ways as follows: Using stod().… Read More
Here, we will see how to swap two numbers using a C++ program. Below are the examples: Input : a = 2, b = 3 Output… Read More
Here, we will see how to read contents from one file and write it to another file using a C++ program. Let us consider two… Read More
Here we will see how to print a 2D array using a C++ program. Below are the examples: Input: {{1, 2, 3},       … Read More
Here we will see how to convert boolean to string using a C++ program. Below are some examples: Input: 1Output: True Input: 0Output: False In… Read More
Here we will see how to print triangle patterns using a C++ program. There are 4 patterns discussed here: Right Triangle. Inverted Right Triangle. Equilateral… Read More
Here, we will see how to print Armstrong numbers between 1 to 1000 using a C++ program.  Armstrong Number A number “N” is an Armstrong… Read More
Exception handling is a manner to handle the runtime error, we carry out exception handling, so, the normal flow of the program may be maintained… Read More
Given two arrays arr1[] and arr2[] of length N and M respectively, the task is to check if the two arrays are equal or not. … Read More
Here, we will see how to multiply two floating-point numbers using the C++ program. Below are the examples: Examples: Input: A =1.2        … Read More
Given the value of R(number of rows), write a C++ program to print the Inverted Hollow Pyramid using stars and white spaces. Examples: Input: R… Read More
Given an integer array of size N, the task is to traverse and print the elements in the array. Examples: Input: arr[] = {2, -1,… Read More
To copy the text/contents of one file to another file, we should know the basics of reading and writing a text file in C++. To… Read More