Created
August 26, 2014 17:08
-
-
Save kolodziej/c604f709d9af6142e7b9 to your computer and use it in GitHub Desktop.
ld2: Obliczanie silni
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
int main(int argc, char ** argv) | |
{ | |
int n = 0; | |
int silnia = 1; | |
cout << "\tObliczanie silni" << endl; | |
cout << "Podaj liczbe z jakiej mam policzyc silnie: "; | |
cin >> n; | |
for (int i = 1; i <= n; silnia *= i++); | |
cout << "n! = " << n << "! = " << silnia << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment