4 ms·
Not sure why the Fortran code is that much simpler, I mean if you don't want to futz around with the IO stuff, C++ can be lot more straightforward. #include
by npalli 5y ago
Not sure why the Fortran code is that much simpler, I mean if you don't want to futz around with the IO stuff, C++ can be lot more straightforward.
#include <iostream>
int main(void)
{
float height, dist;
std::cout << "Height above sea level(m): ";
std::cin >> height;
dist = sqrt(2*6367.45*(height/1000.0));
std::cout << "Distance to Horizon " << dist << " km\n";
return 0;
}
- deleted 5y ago[deleted]