orlandoju

Ejer4_tp3

Apr 6th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main(void){
  6.  
  7.     int i,n1,n2;
  8.     cout<< " Ingrese el primer numero: "<<endl;
  9.     cin>>n1;
  10.  
  11.         cout << "ingreso el segundo numero:  "<< endl;
  12.         cin>> n2;
  13.         cout<<"--------------------"<<endl;
  14.         if(n1>n2){
  15.          for (i = n2; i <=n1; i ++){
  16.           cout<<i<<endl;
  17.          }
  18.      }
  19.    else
  20.  
  21.     for(i=n1; i<=n2; i++){
  22.          cout<<i<<endl;
  23.          }
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment