Advertisement
khristian3000

tp3_5

Apr 8th, 2020
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b,x;
  8.  
  9.     cout << "Introdusca un numero: ";
  10.     cin >> a;
  11.  
  12.     cout << "Introdusca otro numero: ";
  13.     cin >> b;
  14.  
  15.     cout <<endl;
  16.  
  17.     if (a<b) {
  18.     for (x=a;x<=b;x++)
  19.  
  20.     {
  21.  
  22.         cout << x<< endl;
  23.     }}
  24.  
  25.     else {
  26.             for (x=b;x<=a;x++)
  27.  
  28.     {
  29.  
  30.         cout << x<< endl;
  31.     }
  32.  
  33.     }
  34.  
  35.  
  36.  
  37.  
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement