Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n=1;
- while (n <=100)
- {
- cout<< n << endl;
- n++;
- if(n%3 == 0 && n%5 == 0)
- {
- cout<<"fizzbuzz" <<endl;
- n++;
- }
- if(n%3 ==0)
- {
- cout<<"fizz" <<endl;
- n++;
- }
- if(n%5==0)
- {
- cout<<"buzz"<<endl;
- n++;
- }
- }
- cout<<endl;
- system("PAUSE");
- return 0;
- }
Add Comment
Please, Sign In to add comment