online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> int val(char c) { switch(c) { case 'M': return 1000; case 'D': return 500; case 'C': return 100; case 'L': return 50; case 'X': return 10; case 'V': return 5; case 'I': return 1; default: return 0; } } int roman(char *s) { if(*s == 0) return 0; if(val(s[0]) < val(s[1])) return val(s[1]) - val(s[0]) + roman(&s[2]); return val(s[0]) + roman(&s[1]);; } void printRoman(char *s) { printf("%s = %d\n", s, roman(s)); } int main(void) { printRoman("M"); printRoman("MM"); printRoman("MMM"); printRoman("MMMCM"); printRoman("IV"); printRoman("MCMXCIV"); }

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