Advertisement
TheMagnusRex

16(while)

Mar 26th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 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.     int c=a;
  11.     cout<<"B=";
  12.     cin>>b;
  13.     if(a<=b){
  14.         while(c<=b){
  15.             if(c%2==0&&c<0){
  16.                 cout<<c;
  17.             }
  18.             c++;
  19.         }
  20.     }
  21.     else{
  22.         cout<<"error";
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement