Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This program will find the average of three test scores
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- cout << fixed << setprecision(1);
- int num1, num2, num3;
- cout << "Please enter 3 digits: \n";
- cin >> num1 >> num2 >> num3;
- float newNum = static_cast<float>(num1 +num2+num3)/3;
- cout << fixed << setprecision(1);
- cout << "The average is: " << newNum;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement