orlandoju

Ejer13_tp3

Apr 12th, 2022 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(void){
  5.  
  6.     int i,n;
  7.     cout<< " Ingrese un numero: "<<endl;
  8.     cout<<"--------------------"<<endl;
  9.     cin>>n;
  10.       cout<<"--------------------"<<endl;
  11.       cout<<"Los divisores son: "<<endl;
  12.     for(i=1;i<=n;i++){
  13.        
  14.         if(n%i== 0){
  15.          
  16.             cout<<"--"<<i<<"--"<<endl;
  17.         }
  18.     }
  19.      
  20.     return 0;
  21. }
  22.  
Add Comment
Please, Sign In to add comment