← Microsoft questions

Print a pattern without using loops

Filed under Microsoft

Given a number N, print a pattern without using any looping constructs. The pattern typically starts from N, decreases by 5 until it reaches a number <= 0, and then increases by 5 back up to N.

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 Microsoft questions

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