Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int startTemp = 0, endTemp = 0;
- double velocity = 0.0;
- cout.setf(ios::fixed);
- cout.setf(ios::showpoint);
- cout.precision(1);
- cout << "Enter the starting temperature, in degrees Celsius: ";
- cin >> startTemp;
- cout << "Enter the ending temperature, in degrees Celsius: ";
- cin >> endTemp;
- do
- {
- velocity = 331.3 + (0.61 * startTemp);
- cout << "At " << startTemp << " degrees Celsius the velocity of sound is " << velocity << " m\\s\n";
- startTemp++;
- }while(startTemp <= endTemp);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement