Assignment 1

1. Determine and output the factorial of an input number.

CPE102L
1Q1819
start
int fact = 1

print “Enter a positive integer: “
input num

if (num==0)
	print “invalid”

elseif (num<0)
	print “NA”

elseif (num>0)
	while (i<=num)
		fact=fact * i
		i++
	endwhile
	print factorial
endif

end