Add two Numbers (Integer/Decimal) in C++ – Programming, Pseudocode Example, C# Programming Example
C++

Add two Numbers (Integer/Decimal) in C++

In this program, i’ll show you how to add two Numbers in C++ programming language.

To add two numbers in C++, we will ask the user to enter the two number and place the addition of the two number in sum variable of same type and print this variable in the output which is the sum of the two entered numbers as shown here in the following program.

Program to add two Integers in C++

Output:

Program to add two decimal (float) in C++

Just change the datatype of the variables in the above program to float.

Output:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.