1. Home
  2. /
  3. Io
  4. /
  5. Prime Checker

Prime Checker - Io Typing CST Test

Loading…

Prime Checker — Io Code

Checks if a number is prime.

isPrime := method(n, do(
	if(n <= 1, return(false))
	for(i, 2, n-1, if(n % i == 0, return(false)))
	return(true)
))
write(if(isPrime(13), "Prime\n", "Not Prime\n"))

Io Language Guide

Io is a small, prototype-based, object-oriented programming language designed for simplicity, concurrency, and rapid development of distributed applications. It emphasizes minimal syntax, message-passing, and highly dynamic objects.

Primary Use Cases

  • ▸Scripting and automation
  • ▸Embedded system programming
  • ▸Prototyping distributed applications
  • ▸Rapid development of domain-specific languages
  • ▸Concurrent and asynchronous programming

Notable Features

  • ▸Prototype-based object system (no classes)
  • ▸Minimal and consistent syntax
  • ▸Message-passing as primary mechanism
  • ▸Concurrency via coroutines
  • ▸Embeddable and portable interpreter

Origin & Creator

Developed in 2002 by Steve Dekorte.

Industrial Note

Io is valued in niche domains where lightweight, dynamic, and concurrent scripting is required, particularly in experimental software, rapid prototyping, and small-scale distributed systems.

More Io Typing Exercises

Io Counter and Theme ToggleIo Fibonacci SequenceIo Factorial CalculatorIo Sum of ListIo Reverse StringIo Multiplication TableIo Celsius to FahrenheitIo Simple Alarm SimulationIo Random Walk Simulation

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher