In a sentence, you can use the number 42 as a numeral or spell it out depending on the context; for example, ‘The class consisted of forty-two students.’