online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <time.h> #include <stdlib.h> int prod (int a, int b) { return a*b; } int sum (int a, int b) { return a+b; } int (*operation)(int a, int b); int main() { srand(time(NULL)); operation = &sum; int a = rand() % 100; int b = rand() % 100; int sum = (*operation) (a, b); printf("The sum of two numbers %d and %d is %d\n", a, b, sum); operation = &prod; int result = (*operation) (a, b); printf("The product of two numbers %d and %d is %d\n", a, b, result); 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