Pergunta de entrevista da empresa Adacel Systems

Palindrome question. Question on correct output given a code How you would print all prime numbers up to 1000