Thursday, 2 July 2020

Prime Checker Program in CMD

This program is to make a program that checks whether a number is prime or not
  • Start Notepad or Notepad++ on your system
  • Type this:
  • @echo off
    :x
    set /p num=Enter number: 
    set /a n=%num%
    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 
    echo Composite  
    goto x
    :c 
    echo Prime  
    goto x
  • Save it as prime.cmd on desktop and double click the file to start it

No comments:

Post a Comment

Algorithmic Pixel Art: The Beauty of Aliasing

Discussed  here More images in  Google drive Some outputs: Forward to anyone who says aliasing is ugly.