Kaloyankerr

Task

Oct 22nd, 2021
582
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 7.
  2. #include <iostream>
  3. #include <string>
  4. #include <cmath>
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n, mul_of_nums;
  9.    
  10.     cout << "Number n: ";
  11.     cin >> n;
  12.    
  13.     mul_of_nums = 1;
  14.    
  15.     for (int i = 1; i <= n; i++){
  16.        
  17.         mul_of_nums *= i;
  18.     }
  19.    
  20.     cout << "Multiplication of all numbers: "<< mul_of_nums;
  21.     return 0;
  22. }
  23.  
  24.  
  25.  
  26. =========================================
  27. 11.
  28. #include <iostream>
  29. using namespace std;
  30.  
  31. int main() {    
  32.     int n, m;
  33.     cout << "Enter n and m with space between or on different rows:" << endl;
  34.     cin >> n >> m;
  35.    
  36.     for (int i = 1; i <= 100; i++){
  37.         if (i % n == 0 && i % m ==0) {
  38.             cout << i << endl;
  39.         }
  40.     }
  41.   return 0;
  42. }
RAW Paste Data