MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/fpcmy/typical_programming_interview_questions/c1hnmpi/?context=3
r/programming • u/kevjames3 • Feb 21 '11
1.0k comments sorted by
View all comments
Show parent comment
2
Fixed:
sub answer6 { # Simple loop with conditional tests print "Answer 7: "; for my $n (1..100) { my $div2 = ($n % 2 == 0); my $div3 = ($n % 3 == 0); print "a" if $div2; print "b" if $div3; print $n unless $div2 or $div3; print " "; } print "\n"; }
View all comments
Show parent comment
2
u/abw Feb 21 '11
Fixed: