Citadel interview question

Write a program and output all the prime number smaller than an integer N

Interview Answer

Anonymous

14 Feb 2019

Build a bool array of [2-N] numbers, label each number as True at the beginning. Start from 2, if a number is labelled as True, then output it and label all its multiples as False