Is there a command equivalent to lookup(...) in Arduino?

I'm thinking of something like...

answer = 2;
character = lookup('A', 'B', 'C', 'D', 'E');

Printing character would show 'C' (or maybe 'B' depending on how you index the lookup items).

The closest thing I can think of is to use a table (an array of numbers or characters), then walk through the array with a loop until the desired object is found.

You want the second (er, third) item? You don't need to walk it then:

char foo [] = { 'A', 'B', 'C', 'D', 'E' };

int answer = 2;

char response = foo [answer];  // will be 'C'

As long as the array is of ASCII characters the following also works.

int answer = 2;

char response = "ABCDE"[answer];