Factorial Array

#include<stdio.h> int main() { int n, m, i, fact = 1; printf("Input the Number: "); scanf("%d", &n); int ara[n]; for(m = n, i = 0; i < n; i++, m--) ara[i] = m; for(i = 0; i < n; i++) fact *= ara[i]; printf("%d! = %d", n, fact); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.