Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int SILNIA (int n);
- int main()
- {
- int n;
- cout << "Podaj liczbe, dla ktorej chcesz obliczyc silnie" << endl;
- cin >>n;
- cout<<"Silnia rowna sie: "<<SILNIA(n);
- return 0;
- }
- int SILNIA(int n)
- {
- int s;
- s=1;
- do{
- s=s*n;
- n--;}
- while (n>=1);
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement