Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int fact(int n)
- {
- if(n==0 || n==1)
- return 1;
- else
- return n*fact(n-1);
- }
- int main()
- {
- int n;
- int m;
- cout << "Unesite dva broja" << endl;
- cin>>n;
- cin>>m;
- cout<<fact(n);
- cout<<endl;
- if(fact(n)%m==0)
- cout<<"Drugi broj je djeljitelj od faktorijele prvog"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement