Skip to content

Category Archives: C++ Programs

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
Here, we will see a C++ program to print the 3 different number patterns. There are 3 number patterns covered using for loop and while… Read More
What is a leap year? A year consisting 366 days is a leap year.  How to identify a year is leap or not: A year… Read More
Given a number N, the task is to print the prime numbers from 1 to N. Examples:  Input: N = 10 Output: 2, 3, 5,… Read More

Start Your Coding Journey Now!