Abuse C array indexing rules for fun an profit : char x = "1Q2"[rand() % 3];

Could easily be expanded to an arbitrary character array using a const char pointer and strlen() instead of hard-coding...