Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7.
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main() {
- int n, mul_of_nums;
- cout << "Number n: ";
- cin >> n;
- mul_of_nums = 1;
- for (int i = 1; i <= n; i++){
- mul_of_nums *= i;
- }
- cout << "Multiplication of all numbers: "<< mul_of_nums;
- return 0;
- }
- =========================================
- 11.
- #include <iostream>
- using namespace std;
- int main() {
- int n, m;
- cout << "Enter n and m with space between or on different rows:" << endl;
- cin >> n >> m;
- for (int i = 1; i <= 100; i++){
- if (i % n == 0 && i % m ==0) {
- cout << i << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement