online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <stdio.h> using namespace std; // Potisak motora u Njutnima double dEngineThrust = 1971429; // Broj motora na prvom stepenu double dNumOfEngines = 35; // Ukupan potisak u Njutnima double dTotalThrust; // Specifican impuls motora u sekundama double dIsp = 330; // Gravitaciona konstanta 9.81 N/kg const double cdg = 9.81; // Inkrement vremena u sekundama const double dt = 0.01; // Masa kompletne rakete u kg double dStartMass = 4655000; // Trenunta masa rakete double dCurrentMass; // Protok goriva u N/sec double dFuelFlow; // Brzina rakete u m/sec double dVelocity = 0; // Prethodna brzina double dOldVelocity; // Finalna brzina u m/sec const double cdFinalVelocity = 100; // Visina rakete u m double dHeight = 0; // Simulacija u odsustvu gravitacije Da/Ne (true/false) bool bSimNoGravity = false; // Potroseno goriva u tonama double dFuelSpent; int main() { int dIt = 0; dCurrentMass = dStartMass; dTotalThrust = dEngineThrust*dNumOfEngines; dFuelFlow = dTotalThrust/(dIsp*cdg); while(dVelocity < cdFinalVelocity) { dIt++; dOldVelocity = dVelocity; dCurrentMass = dCurrentMass - dt * dFuelFlow; if (bSimNoGravity) { dVelocity = dVelocity + dTotalThrust/dCurrentMass*dt; } else { dVelocity = dVelocity + (dTotalThrust/dCurrentMass - cdg)*dt; } dHeight = dHeight + (dOldVelocity + dVelocity)*dt/2; } dFuelSpent = (dStartMass - dCurrentMass)/1000.0; double dCurrentMassT = dCurrentMass/1000.0; double dTime = dIt*dt; printf("Krajnja masa : %10.2f t\n", dCurrentMassT); printf("Potroseno gorivo: %10.2f t\n", dFuelSpent); printf("Visina : %10.2f m\n", dHeight); printf("Vreme : %10.2f sec\n", dTime); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue