Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <stdlib.h>
- int main()
- {
- int n,i;
- int res;
- unsigned long long fact = 1;
- printf("Enter number: ");
- scanf("%d",&n);
- if(n >= -7 && n <= 7)
- {
- if(n <= 0)
- {
- printf("Error");
- }
- else
- {
- for(i = 1; i <= n; i++)
- {
- fact *= i;
- }
- }
- printf("%llu\n", fact);
- }
- else
- {
- printf("Error");
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement