online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; uint8_t calculateWeekday( uint8_t day, uint8_t month, uint8_t century, uint8_t year ) { const uint8_t monthFactor = ( ( month+9 ) % 12 ) + 1; const uint8_t yearFactor = ( month > 2 ? year : ( ( year + 100 -1 ) % 100 ) ); const uint8_t centuryFactor = month > 2 ? century : year == 0 ? century - 1 : century; //in zwei Berechnungen aufgeteilt, //da die Zahl negativ werden kΓΆnnte und //das wird mit der while-Schleife korrigiert uint8_t tmp1 = day + ( 2.6 * monthFactor - 0.2 ) + yearFactor + ( yearFactor/4 ) + ( centuryFactor/4 ); uint8_t tmp2 = 2 * centuryFactor; while ( tmp1 < tmp2 ) { tmp1+=7; } return (tmp1 - tmp2) % 7; } int main(){ //1=Montag,7=Sonntag cout << unsigned( calculateWeekday( 30, 11, 20, 20 ) ) << endl; }

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