Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n = 0;
- int res = 1;
- printf("n:");
- scanf("%i",&n);
- if(n % 2 == 0)
- {
- while(n > 0)
- {
- res = res * n;
- n = n - 2;
- }
- }
- else
- {
- while(n > 0)
- {
- res = res * n;
- n = n - 2;
- }
- }
- printf("res = %i",res);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement