This program aims to make a program that will give a list of prime numbers (slowly...) from 2 to infinity.
- Start notepad.exe on your system or Notepad++
- Type the following:
@echo off
echo 2
set /a n=1
:x
set /a n=%n%+2
set /a s=1
:a
set /a s=%s%+1
if %s% equ %n% goto c
set /a a=%n% %% %s%
if %a% equ 0 goto b
goto a
:b
goto x
:c
echo %n%
goto x
- Save this as primelist.cmd at desktop
- Double-click on the file to start the program
No comments:
Post a Comment