Calculate factorial value of any number using awk command



BEGIN
{           main();   }
function main()
{    facto();    }
function facto()
{
 printf("\n Enter The Number: ");
 getline n;
 fact=1;
 for(i=n;i>1;i--)
  fact=fact*i;
 printf("\nFactorial of %d is %d",n,fact);
}


291 views0 comments

Recent Posts

See All