Guest User

Untitled

a guest
Aug 15th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. void main() {
  2. for ( int i = 1; i <= 100; ++i ) {
  3. bool divByThree = ( i % 3 == 0 );
  4. bool divByFive = ( i % 5 == 0 );
  5. if ( divByThree && divByFive ) {
  6. print( "FizzBuzz" );
  7. } else if ( divByThree ) {
  8. print( "Fizz" );
  9. } else if ( divByFive ) {
  10. print( "Buzz" );
  11. } else {
  12. print( i );
  13. }
  14. }
  15. }
Add Comment
Please, Sign In to add comment