C++ program to add three numbers
In this post we will give you information about C++ program to add three numbers. Hear we will give you detail about C++ program to add three numbersAnd how to use it also give you demo for it if it is necessary.
In this example, you will learn about how to calculate the sum of three (3) numbers in C++.
#include <iostream>using namespace std;int main(){ int firstNumber, secondNumber, thirdNumber, sum; cout << "Enter three integers to addn"; // taking input of three numbers cin >> firstNumber >> secondNumber >> thirdNumber; // adding three numbers sum = firstNumber + secondNumber + thirdNumber ; // displaying sum cout <<"Sum of three numbers is: " << sum << endl; return 0;}
You can also learn, C++ program to add two numbers.
Hope this code and post will helped you for implement C++ program to add three numbers. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs