Assignment 1

5. Ask for a range of number (lower limit and upper limit), and output all Prime numbers from the input range.

CPE102L
1Q1819
start

input LL, UL

if(LL>UL)
temp=LL
LL=UL
UL=temp
endif

num=LL
while (num<=UL)
	factor=2
prime=1
	while(factor<=num/2)
		if (num%factor==0)
			prime=0
			factor=num
		endif
		factor++
	endwhile

	if (prime==1)
		print num
	endif
	num++
endwhile

end