← Amazon questions
CodingReported in a candidate post, Jun 2019

Read file and print based on divisibility

Filed under Amazon

Read a file containing one integer per line. For each number, print 'c' if divisible by 15, 'b' if divisible by 3, 'a' if divisible by 5, or the number itself otherwise.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.