windows - Batch Program - Prime Number Checker -


i'm programming in batch using fact forall n between 1 , 100, (2^n-2) mod n 0 if n prime, , not 0 if otherwise. when run program, "missing operator" error. flaw in code?

@echo off color f0 title prime number checker echo -------------------------------------------------------- echo  prime number checker v1.0 echo -------------------------------------------------------- echo. set /p n=enter number between 1 , 100:  set result=1 set i=1 :multiply set /a result=result*2 set /a i=i+1 if %i% lss %n% goto multiply set /a result = result - 2 set /a result = result % n if %result% == 0 echo number prime. if %result% neq 0 echo number not prime. pause <nul 


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -