Advertisement
TheMagnusRex

16(for)

Mar 26th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b;
  8.     cout<<"A=";
  9.     cin>>a;
  10.     cout<<"B=";
  11.     cin>>b;
  12.     if(a<=b){
  13.         for(int i =a;i<b+1;i++){
  14.             if(i<0&&i%2==0){
  15.                 cout<<i<<" ";
  16.             }
  17.         }
  18.     }
  19.     else{
  20.         cout<<"error";
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement