document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /*
  2. Write a program that prints the numbers from 1 to 100.
  3. But for multiples of three print “Fizz” instead of the number and
  4. for the multiples of five print “Buzz”.
  5. For numbers which are multiples of both three and five print “FizzBuzz”.
  6. */
  7. #include <iostream>
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     int counter;
  13.     for (counter=1;counter<=100;counter++)
  14.     {
  15.         if (counter%3!= 0 && counter%5 != 0)
  16.         {
  17.             cout << counter << endl;
  18.         }
  19.         else
  20.         {
  21.             if (counter % 3 == 0)
  22.                cout << "Fizz";
  23.             if (counter % 5 == 0)
  24.                cout << "Buzz";
  25.             cout << endl;
  26.         }
  27.     }
  28.     cin.get();
  29.     return 0;
  30. }
');