C++

Programs

C++ program for Armstrong Number

In this article, you will learn a C++ program for Armstrong Number. In this C++ program, the user is asked to enter any number the program tells whether it’s an Armstrong number or not. Armstrong numbers are those numbers that are equal to the sum of cubes of their digits. Example 1: Check Armstrong Number … Read more

Programs

C++ program to concatenate two string

In this program, you will learn a C++ program to concatenate two strings. In C++ programming string concatenation is the process of joining two or more strings to form a new resultant string. Here we discuss three different approaches to joining strings. 1: Using the “+” operator 2: Using strcat () function 3: Using the … Read more

Programs

C++ Program to remove spaces from a string

In this article, you will learn a C++ Program to remove spaces from a string. Sometimes the programmer wants to remove spaces from the string. This program is very useful for that time. For example, if we have a string “Hello World” the program displays it as “HelloWorld”. Example 1: Remove spaces from a string … Read more

Programs

C++ program for matrix multiplication

In this article, you will learn a C++ program for matrix multiplication using arrays. We can multiply two matrices if the number of columns of the first matrix is equal to the number of rows of the second matrix. Example 1: Matrix multiplication in C++ This program asks the user to enter the matrix size, … Read more

Programs

C++ Program to find Sum of digits

In this article, you will learn a C++ program to find the sum of digits by using a while loop and mathematical operators. For example, if the user enters 345 the sum of the digits will be 12. Example 1: Sum of digits in C++ This program asks the user to enter any number through … Read more

Programs

C++ program to find Transpose of matrix using array

In this article, you will learn a C++ program to find the Transpose of a matrix using an array. Transpose can be calculated by interchanging matrix rows into columns and columns into rows. Example: Find the transpose of a matrix in C++ This C++ program takes matrix size and its rows and columns elements from … Read more

Programs

C++ program for the subtraction of two matrices

In this article, you will learn a C++ program for the subtraction of two matrices. The two matrices are added and subtracted if both have the same dimensions. Example: Addition of two matrices in C++ In this program, we will use a multidimensional array to store the elements of matrices and perform subtraction. After subtraction … Read more

Programs

C++ program for the Addition of two matrices

In this article, you will learn a C++ program for the addition of two matrices. The matrices are the arrangement of numbers into rows and columns. If we have a matrix having 2 rows and 3 columns. We can say that it’s a 2X3 matrix. Two matrices are added if both have the same dimensions. … Read more

Programs

C++ program for simple calculator

In this article, you will learn a C++ program for simple calculator using switch statement. This program takes any of the operators (+, -. *, /) and two numbers from the user to perform addition, subtraction, multiplication, or division. Let’s have a look if the user enters 5 and 8 as two numbers along with … Read more

Programs

C++ program to display Fibonacci series

In this article, you will learn about a C++ program to display Fibonacci series. The series begins with 0 and 1.  And the next number in the series is the sum of the previous two numbers. This sequence in the series goes on to infinity. By following the above rule the Fibonacci sequence looks like … Read more

Scroll to Top