added while loop snippet
Merge pull request #42 from daniel614/master

added while loop snippet