Skip to main content
Commonmark migration
Source Link

##QBIC, 7 5 bytes

QBIC, 7 5 bytes

:?a%2

This prints 0 for even values, and 1 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)

##QBIC, 7 5 bytes

:?a%2

This prints 0 for even values, and 1 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)

QBIC, 7 5 bytes

:?a%2

This prints 0 for even values, and 1 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)
deleted 63 characters in body
Source Link
steenbergh
  • 8.1k
  • 1
  • 25
  • 41

##QBIC, 77 5 bytes

:?a%2=0a%2

This prints -1 (QBasic's idea of true0 for even values, and 01 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)
=0    compared to 0. This yields -1 or 0

##QBIC, 7 bytes

:?a%2=0

This prints -1 (QBasic's idea of true for even values, and 0 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)
=0    compared to 0. This yields -1 or 0

##QBIC, 7 5 bytes

:?a%2

This prints 0 for even values, and 1 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)
Source Link
steenbergh
  • 8.1k
  • 1
  • 25
  • 41

##QBIC, 7 bytes

:?a%2=0

This prints -1 (QBasic's idea of true for even values, and 0 for odds.

Explanation:

:   get a number from the cmd line args
?   PRINT
a%2 The input modulo 2 (1 for odds, 0 even)
=0    compared to 0. This yields -1 or 0