Advertisement
Josif_tepe

Untitled

May 7th, 2021
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int funkcija(int n) {
  6.    int proizvod = 1;
  7.    for (int i = 1; i <= n; i++)
  8.    {
  9.        proizvod *= i;
  10.  
  11.    }
  12.    cout << proizvod << endl;
  13. }
  14.  
  15. int main()
  16. {
  17.     int n;
  18.     cin >> n;
  19.     funkcija(n);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement