Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i;
- int x, y=1;
- cout << "Podaj pierwszy kraniec przedzialu" << endl;
- cin >> x;
- if (x < 0)
- {
- cout << "Podana liczba jest ujemna" << endl;
- }
- else if (x == 0)
- {
- cout << "Silnia z 0!=1" << endl;
- }
- else
- {
- for (i = 1; i <= x; i++)
- {
- y = y * i;
- }
- cout << "Silnia z !" << x << "=" << y << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement