Advertisement
ivanwidyan

10 Birds and They Fly Away One by One

Oct 17th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int birdsamount = 10;
  6.     for (birdsamount; birdsamount > 0; birdsamount--) {
  7.         if (birdsamount > 1) {
  8.             cout << "There are " << birdsamount << " birds on the trees." << endl;
  9.             cout << "One bird flies away" << endl;
  10.         }
  11.         else {
  12.             cout << "There are " << birdsamount << " bird on the trees." << endl;
  13.             cout << "One bird flies away" << endl;
  14.         }
  15.     }
  16.     cout << "There is no bird on the tree" << endl;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement