write a program to add three numbers in c++
Answers
Answered by
2
Answer:
#include <iostream>
using namespace std;
int main()
{
int firstNumber, secondNumber, thirdNumber, sum;
cout << "Enter three integers to add\n";
// 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;
}
Similar questions