Format MAC Address in C

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> void format_mac(void){ char macAddr[18]; const char *macRaw = "123456789999"; int i, out = 0; for (i = 0; i < 12; i++) { macAddr[out] = macRaw[i]; out++; if (i > 0 && i < 11 && ((i + 1) % 2) == 0) { macAddr[out] = ':'; out++; } } printf( macAddr ); } int main(void) { printf("Hello World!\n"); format_mac(); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines