Literals/Integer: Difference between revisions
Content added Content deleted
(Added Kotlin) |
|||
Line 151: | Line 151: | ||
17 |
17 |
||
17</pre> |
17</pre> |
||
==={{header|BaCon}}=== |
|||
BaCon allows (as it converts to C) C style integer literals. zero prefix Octal, 0x prefix Hexadecimal, no prefix Decimal, and if supported by the underlying compiler, 0b prefix for Binary. 0x and 0b can be upper case 0X and 0B. |
|||
<lang freebasic>' literal integers |
|||
PRINT 10 |
|||
PRINT 010 |
|||
PRINT 0x10 |
|||
' C compiler dependent, GCC extension |
|||
PRINT 0b10</lang> |
|||
{{out}} |
|||
<pre>prompt$ bacon literal-integer.bac |
|||
Converting 'literal-integer.bac'... done, 6 lines were processed in 0.002 seconds. |
|||
Compiling 'literal-integer.bac'... cc -c literal-integer.bac.c |
|||
cc -o literal-integer literal-integer.bac.o -lbacon -lm |
|||
Done, program 'literal-integer' ready. |
|||
prompt$ ./literal-integer |
|||
10 |
|||
8 |
|||
16 |
|||
2</pre> |
|||
=={{header|BBC BASIC}}== |
=={{header|BBC BASIC}}== |