online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> using namespace std; void sum_one_bit (bool a, bool b, bool c, bool & sum, bool & carry); long sum_int (int a, int b); long subtraction_int (int a, int b); int biger( int g,int f); int main () { //cout<<"Hello World"; int max= biger(500,100); max= biger(2000,1999); max= biger(5000,2); max= biger(10000,9000); max= biger(45000,20000); max= biger(6000,4000); return 0; } int biger( int g,int f) { long summ = sum_int (g, f); long subb = subtraction_int (g, f); long sum_sub = sum_int (summ, subb); long max = sum_sub >> 1; cout<< "a="<<g<<" b="<<f<<" max="<<max<<"\r\n"; return max; } //---------------------------------------------------------- //--------------------------------------------------------------- //--------------------------------------------------------------- long subtraction_int (int a, int b) { bool b0 = (b & 0x01); bool b1 = (b & 0x02); bool b2 = (b & 0x04); bool b3 = (b & 0x08); bool b4 = (b & 0x10); bool b5 = (b & 0x20); bool b6 = (b & 0x40); bool b7 = (b & 0x80); bool b8 = (b & 0x100); bool b9 = (b & 0x200); bool b10 = (b & 0x400); bool b11 = (b & 0x800); bool b12 = (b & 0x1000); bool b13 = (b & 0x2000); bool b14 = (b & 0x4000); bool b15 = (b & 0x8000); b0 = ~b0 & 0x01; b1 = ~b1 & 0x01; b2 = ~b2 & 0x01; b3 = ~b3 & 0x01; b4 = ~b4 & 0x01; b5 = ~b5 & 0x01; b6 = ~b6 & 0x01; b7 = ~b7 & 0x01; b8 = ~b8 & 0x01; b9 = ~b9 & 0x01; b10 = ~b10 & 0x01; b11 = ~b11 & 0x01; b12 = ~b12 & 0x01; b13 = ~b13 & 0x01; b14 = ~b14 & 0x01; b15 = ~b15 & 0x01; int bb = b15 << 15 | b14 << 14 | b13 << 13 | b12 << 12 | b11 << 11 | b10 << 10 | b9 << 9 | b8 << 8 | b7 << 7 | b6 << 6 | b5 << 5 | b4 << 4 | b3 << 3 | b2 << 2 | b1 << 1 | b0 << 0; long bbb = sum_int (a, bb); return (sum_int (bbb, 1)); } //---------------------------------------------------------- //--------------------------------------------------------------- //--------------------------------------------------------------- long sum_int (int a, int b) { bool a0 = a & 0x01; bool a1 = a & 0x02; bool a2 = a & 0x04; bool a3 = a & 0x08; bool a4 = a & 0x10; bool a5 = a & 0x20; bool a6 = a & 0x40; bool a7 = a & 0x80; bool a8 = a & 0x100; bool a9 = a & 0x200; bool a10 = a & 0x400; bool a11 = a & 0x800; bool a12 = a & 0x1000; bool a13 = a & 0x2000; bool a14 = a & 0x4000; bool a15 = a & 0x8000; bool b0 = b & 0x01; bool b1 = b & 0x02; bool b2 = b & 0x04; bool b3 = b & 0x08; bool b4 = b & 0x10; bool b5 = b & 0x20; bool b6 = b & 0x40; bool b7 = b & 0x80; bool b8 = b & 0x100; bool b9 = b & 0x200; bool b10 = b & 0x400; bool b11 = b & 0x800; bool b12 = b & 0x1000; bool b13 = b & 0x2000; bool b14 = b & 0x4000; bool b15 = b & 0x8000; bool carry = 0; bool sum; bool s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16; sum_one_bit (a0, b0, carry, sum, carry); s0 = sum; sum_one_bit (a1, b1, carry, sum, carry); s1 = sum; sum_one_bit (a2, b2, carry, sum, carry); s2 = sum; sum_one_bit (a3, b3, carry, sum, carry); s3 = sum; sum_one_bit (a4, b4, carry, sum, carry); s4 = sum; sum_one_bit (a5, b5, carry, sum, carry); s5 = sum; sum_one_bit (a6, b6, carry, sum, carry); s6 = sum; sum_one_bit (a7, b7, carry, sum, carry); s7 = sum; sum_one_bit (a8, b8, carry, sum, carry); s8 = sum; sum_one_bit (a9, b9, carry, sum, carry); s9 = sum; sum_one_bit (a10, b10, carry, sum, carry); s10 = sum; sum_one_bit (a11, b11, carry, sum, carry); s11 = sum; sum_one_bit (a12, b12, carry, sum, carry); s12 = sum; sum_one_bit (a13, b13, carry, sum, carry); s13 = sum; sum_one_bit (a14, b14, carry, sum, carry); s14 = sum; sum_one_bit (a15, b15, carry, sum, carry); s15 = sum; s16 = carry; return s16 << 16 | s15 << 15 | s14 << 14 | s13 << 13 | s12 << 12 | s11 << 11 | s10 << 10 | s9 << 9 | s8 << 8 | s7 << 7 | s6 << 6 | s5 << 5 | s4 << 4 | s3 << 3 | s2 << 2 | s1 << 1 | s0 << 0; } //--------------------------------------------------------------- //--------------------------------------------------------------- //--------------------------------------------------------------- void sum_one_bit (bool a, bool b, bool c, bool & sum, bool & carry) { bool x = a ^ b; sum = x ^ c; carry = (x & c) | (a & b); }

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