राइट ए प्रोग्राम इन सी प्लस प्लस टू इनपुट 3 नंबर्स एंड डिस्पले सम एंड एवरेज
Answers
Answered by
0
Answer:
write a program in c++ to input three numbers and display sum and average
Explanation:
#include <iostream>
using namespace std;
int main()
{
int firstNumber, secondNumber,thirdNumber, sumOfTwoNumbers,avgOfThreeNumbers ;
cout << "Enter three Numbers: ";
cin >> firstNumber >> secondNumber>>thirdNumber;
// sum of three numbers
sumOfThreeNumbers = firstNumber + secondNumber+thirdNumber;
// average of three numbers
avgOfThreeNumbers = (firstNumber + secondNumber+thirdNumber)/3;
// Prints sum
cout << sumOfThreeNumbers ;
// Prints average
cout << avgOfThreeNumbers ;
return 0;
}
Similar questions