c interview questions for experienced
snippet in c

c interview questions for experienced

user9838

#include <stdio.h>#include <conio.h>long factorial (int n){    if (n==0)    return 1;    else    return (n * factorial(n-1)); //recursion}void main(){    int number;    long fact;    printf("Enter a number: ");    scanf("%d", &number);    fact = factorial(number);    printf("The factorial of %d is %ld!\n", number, fact);    getch();}