Advertisement
Josif_tepe

Untitled

Feb 15th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.     using namespace std;
  3.     int main()
  4.     {
  5.         int n;
  6.         cin >> n;
  7.         for(int i = 1; i <= n; i++) { // for each number from 1 till the number itself
  8.             if(n % i == 0) {
  9.                 cout << i << " is a divisor." << endl;
  10.             }
  11.         }
  12.         return 0;
  13.     }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement