This is an old revision of the document!
Teaching C++
main.cpp
#include <iostream> using namespace std; int main() { int value = 0; cout << "Enter an integer: "; cin >> value; cout << "You entered: " << value << endl; return 0; }
build.sh
gcc main.cpp -lstdc++ -o hello
Practice
Compute the range of the projectile.
angleR = angleD * Pi / 180.0; range = sin(2.0 * angleR) * pow(velocity, 2) / gravity;