WAP to find the Factorial of a given number

Question:
Write a program to find the factorial of a given number.

 

Ans:

      INPUT “Enter the number :::” ; n

      f = 1

      For i  = 1 TO n

      f = f * i

      NEXT I

      PRINT “Factorial of the given number = ” ; f

      END

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top