Created
October 20, 2017 23:29
-
-
Save Mozart2234/3b89a1e10353d28c8a25069df0011c19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i; | |
int x; | |
cout << "Ingrese un valor: "; | |
cin >> i; | |
cout << "Ingrese otro valor mayor que el primero: "; | |
cin >> x; | |
int temp = i; | |
int temp2 = x; | |
bool turn = true; | |
while(temp != x || temp2 != i) { | |
if(turn){ | |
cout << temp << endl; | |
temp +=2; | |
} | |
else{ | |
temp2 -=2; | |
cout << temp2 << endl; | |
} | |
turn = !turn; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment