task_url stringlengths 30 116 | task_name stringlengths 2 86 | task_description stringlengths 0 14.4k | language_url stringlengths 2 53 | language_name stringlengths 1 52 | code stringlengths 0 61.9k |
|---|---|---|---|---|---|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Elm | Elm |
import Array
import Html
main : Html.Html
main =
["apple", "orange"]
|> Array.fromList
|> Array.length
|> Basics.toString
|> Html.text
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Emacs_Lisp | Emacs Lisp | (length ["apple" "orange"])
=> 2 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Erlang | Erlang |
1> length(["apple", "orange"]). %using a list
2
1> tuple_size({"apple", "orange"}). %using a tuple
2
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Euphoria | Euphoria |
sequence s = {"apple","orange",2.95} -- Euphoria doesn't care what you put in a sequence
? length(s)
3 -- three objects
? length(s[1])
5 -- apple has 5 characters
? length(s[1][$])
1 -- 'e' is an atomic value
? length(s[$])
1 -- 2.95 is an atomic value
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #F.23 | F# | [|1;2;3|].Length |> printfn "%i" |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Factor | Factor |
{ "apple" "orange" } length
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Forth | Forth | : STRING, ( caddr len -- ) \ Allocate space & compile string into memory
HERE OVER CHAR+ ALLOT PLACE ;
: " ( -- ) [CHAR] " PARSE STRING, ; \ Parse input to " and compile to memory
\ Array delimiter words
: { ALIGN 0 C, ; \ Compile 0 byte start/end of array
: } ALIGN 0 C, ;
\... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Fortran | Fortran |
MODULE EXAMPLE
CONTAINS
SUBROUTINE ABOUND(A)
CHARACTER*(*) A(:) !One dimensional array, unspecified bounds.
WRITE (6,*) "Lower bound",LBOUND(A),", Upper bound",UBOUND(A)
WRITE (6,*) "Element size",LEN(A(LBOUND(A)))
WRITE (6,*) A
END SUBROUTINE ABOUND... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #FreeBASIC | FreeBASIC | ' FB 1.05.0 Win64
Dim fruit(1) As String = {"apple", "orange"}
Dim length As Integer = UBound(fruit) - LBound(fruit) + 1
Print "The length of the fruit array is"; length
Print
Print "Press any key to quit the program"
Sleep |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Frink | Frink |
a = ["apple", "orange"]
println[length[a]]
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #FurryScript | FurryScript | THE_LIST( <apple> <orange> )
COUNT[ 0 SW ~| COUNT_STEP# 0 SW SU ]
COUNT_STEP[ DR 1 SU ]
`THE_LIST COUNT# +<> |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Futhark | Futhark |
fun length(as: []int): int = (shape as)[0]
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #FutureBasic | FutureBasic |
window 1
print fn ArrayCount( @[@"apple",@"orange",@"cherry",@"grape",@"lemon"] )
HandleEvents
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #F.C5.8Drmul.C3.A6 | Fōrmulæ | Public Sub Main()
Dim siList As Short[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
Print siList.Count
End |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Gambas | Gambas | Public Sub Main()
Dim siList As Short[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
Print siList.Count
End |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Genie | Genie | [indent=4]
/* Array length, in Genie */
init
arr:array of string = {"apple", "orange"}
stdout.printf("%d ", arr.length)
print arr[1] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Go | Go | package main
import "fmt"
func main() {
arr := [...]string{"apple", "orange", "pear"}
fmt.Printf("Length of %v is %v.\n", arr, len(arr))
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Groovy | Groovy |
def fruits = ['apple','orange']
println fruits.size()
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Harbour | Harbour |
LOCAL aFruits := {"apple", "orange"}
Qout( Len( aFruits ) ) // --> 2
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Haskell | Haskell | -- [[Char]] -> Int
length ["apple", "orange"] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #hexiscript | hexiscript | let a arr 2
let a[0] "apple"
let a[1] "orange"
println len a |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Hoon | Hoon | |= arr=(list *) (lent arr) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #i | i | main: print(#["apple", "orange"]) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Icon_and_Unicon | Icon and Unicon | write(*["apple", "orange"]) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Idris | Idris | length ["apple", "orange"] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #J | J | # 'apple';'orange'
2
$ 'apple';'orange'
2 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Janet | Janet |
(def our-array @["apple" "orange"])
(length our-array)
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Java | Java | public class ArrayLength {
public static void main(String[] args) {
System.out.println(new String[]{"apple", "orange"}.length);
}
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #JavaScript | JavaScript | console.log(['apple', 'orange'].length); |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #jq | jq | ["apple","orange"] | length |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #0815 | 0815 |
|~>|~#:end:>
<:61:x<:3d:=<:20:$==$~$=${~>%<:2c:~$<:20:~$
<:62:x<:3d:=<:20:$==$~$=${~>%<:a:~$$
<:61:x<:2b:=<:20:$==$~$=$<:62:x<:3d:=<:20:$==$~$=${x{x~>~>~+%<:a:~$
<:61:x<:2d:=<:20:$==$~$=$<:62:x<:3d:=<:20:$==$~$=${x{x~>~>~-%<:a:~$
<:61:x<:2a:=<:20:$==$~$=$<:62:x<:3d:=<:20:$==$~$=${x{x~>~>~*%<:a:~$
<:61:x<:2f:=<:20:$==... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Jsish | Jsish | /* Array length, in jsish */
var arr = new Array('apple', 'orange');
puts(arr.length);
puts(arr[1]); |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Julia | Julia |
a = ["apple","orange"]
length(a)
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #11l | 11l | V a = Int(input())
V b = Int(input())
print(‘a + b = ’(a + b))
print(‘a - b = ’(a - b))
print(‘a * b = ’(a * b))
print(‘a / b = ’(a I/ b))
print(‘a % b = ’(a % b))
print(‘a ^ b = ’(a ^ b)) |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #360_Assembly | 360 Assembly | * Arithmetic/Integer 04/09/2015
ARITHINT CSECT
USING ARITHINT,R12
LR R12,R15
ADD L R1,A
A R1,B r1=a+b
XDECO R1,BUF
MVI BUF,C'+'
XPRNT BUF,12
SUB L R1,A
S R1,B r1=a-b
... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Klingphix | Klingphix | include ..\Utilitys.tlhy
( "apple" "orange" ) len print
" " input |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Klong | Klong |
#["apple" "orange"]
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #6502_Assembly | 6502 Assembly | Arithmetic: PHA ;push accumulator and X register onto stack
TXA
PHA
JSR GetUserInput ;routine not implemented
;two integers now in memory locations A and B
;addition
LDA A
CLC
ADC B
JSR DisplayAddition ;routine not implemented
;subtraction
LDA A
SEC
SBC B
JSR DisplaySubtraction ;routine ... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Kotlin | Kotlin | fun main(args: Array<String>) {
println(arrayOf("apple", "orange").size)
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Lambdatalk | Lambdatalk |
{A.length {A.new 1 2 3}}
-> 3
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #68000_Assembly | 68000 Assembly | ADD.L D0,D1 ; add two numbers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SUB.L D1,D0 ; subtract D1 from D0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MULU D0,D1 ; multiply two unsigned numbers. Use MULS for signed numbers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DIVU D1,D0 ; Divide D0 by D1. Use DIVS for signed numbers. Upper two bytes of D0 ar... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Latitude | Latitude | println: ["apple", "orange"] length. |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Liberty_BASIC | Liberty BASIC |
FruitList$(0)="apple" 'assign 2 cells of a list array
FruitList$(1)="orange"
dimension=dimension(FruitList$()) 'first get the dimension of the array
if dimension>3 then
print "Sorry, program only written for array dimensions of 3 or less."
end
end if
call elements FruitList$(), dimension 'next get the size o... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #AArch64_Assembly | AArch64 Assembly |
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program arith64.s */
/*******************************************/
/* Constantes file */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #ABAP | ABAP | report zz_arithmetic no standard page heading.
" Read in the two numbers from the user.
selection-screen begin of block input.
parameters: p_first type i,
p_second type i.
selection-screen end of block input.
" Set the text value that is displayed on input request.
at selection-screen output.
%_p_... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #LIL | LIL | # Array length, in LIL
set a [list "apple"]
append a "orange"
print [count $a]
print [index $a 1] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Limbo | Limbo | implement Command;
include "sys.m";
sys: Sys;
include "draw.m";
include "sh.m";
init(nil: ref Draw->Context, nil: list of string)
{
sys = load Sys Sys->PATH;
a := array[] of {"apple", "orange"};
sys->print("length of a: %d\n", len a);
} |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #ACL2 | ACL2 |
:set-state-ok t
(defun get-two-nums (state)
(mv-let (_ a state)
(read-object *standard-oi* state)
(declare (ignore _))
(mv-let (_ b state)
(read-object *standard-oi* state)
(declare (ignore _))
(mv a b state))))
(defun integer-arithmetic (state)
(mv-let... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Lingo | Lingo | fruits = ["apple", "orange"]
put fruits.count
-- 2 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Little | Little | string fruit[] = {"apples", "oranges"};
puts(length(fruit)); |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Action.21 | Action! | DEFINE NO_KEY="255"
DEFINE KEY_Y="43"
DEFINE KEY_N="35"
PROC Main()
BYTE CH=$02FC ;Internal hardware value for last key pressed
BYTE k
INT a,b
DO
Print("Input integer value a=")
a=InputI()
Print("Input integer value b=")
b=InputI()
PrintF("a+b=%I%E",a+b)
PrintF("a-b=%I%E",a-b)
... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Ada | Ada | with Ada.Text_Io;
with Ada.Integer_Text_IO;
procedure Integer_Arithmetic is
use Ada.Text_IO;
use Ada.Integer_Text_Io;
A, B : Integer;
begin
Get(A);
Get(B);
Put_Line("a+b = " & Integer'Image(A + B));
Put_Line("a-b = " & Integer'Image(A - B));
Put_Line("a*b = " & Integer'Image(A * B));
Put_... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #LiveCode | LiveCode | put "apple","orange" into fruit
split fruit using comma
answer the number of elements of fruit |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Lua | Lua | -- For tables as simple arrays, use the # operator:
fruits = {"apple", "orange"}
print(#fruits)
-- Note the # symbol does not work for non-integer-indexed tables:
fruits = {fruit1 = "apple", fruit2 = "orange"}
print(#fruits)
-- For this you can use this short function:
function size (tab)
local count = 0
for k,... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Aikido | Aikido | var a = 0
var b = 0
stdin -> a // read int from stdin
stdin -> b // read int from stdin
println ("a+b=" + (a + b))
println ("a-b=" + (a - b))
println ("a*b=" + (a * b))
println ("a/b=" + (a / b))
println ("a%b=" + (a % b)) |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #ALGOL_68 | ALGOL 68 | main:(
LONG INT a=355, b=113;
printf(($"a+b = "gl$, a + b));
printf(($"a-b = "gl$, a - b));
printf(($"a*b = a×b = "gl$, a * b));
printf(($"a/b = "gl$, a / b));
printf(($"a OVER b = a%b = a÷b = "gl$, a % b));
printf(($"a MOD b = a%*b = a%×b = a÷×b = a÷*b = "gl$, a %* b));
printf(($"a UP b = a**b = a↑b = ... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #M2000_Interpreter | M2000 Interpreter |
\\ A is a pointer to array
A=("Apple", "Orange")
Print Len(A)=2 ' True
Print Dimension(A, 0) ' LBound (0 or 1), here 0
Print Dimension(A) ' No of Dimensions 1
Print Dimension(A, 1) ' for 1 dimension array this is also Length=2
\\ A$( ) is an Array (not a pointer to array)
Dim Base 1, A$(2)
A$(1)="Apple", "Orange"... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Maple | Maple | a := Array(["apple", "orange"]);
numelems(a); |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #ALGOL_W | ALGOL W | begin
integer a, b;
write( "Enter 2 integers> " );
read( a, b );
write( "a + b: ", a + b ); % addition %
write( "a - b: ", a - b ); % subtraction %
write( "a * b: ", a * b ); % multiplication %
write( "a / b: ", a div b ); % integer division %
write( "a mod b... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #AmigaE | AmigaE | PROC main()
DEF a, b, t
WriteF('A = ')
ReadStr(stdin, t)
a := Val(t)
WriteF('B = ')
ReadStr(stdin, t)
b := Val(t)
WriteF('A+B=\d\nA-B=\d\n', a+b, a-b)
WriteF('A*B=\d\nA/B=\d\n', a*b, a/b)
/* * and / are 16 bit ops; Mul and Div are 32bit ops */
WriteF('A*B=\d\nA/B=\d\n', Mul(a,b), Div(a,b))
Write... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Mathematica.2FWolfram_Language | Mathematica/Wolfram Language | Length[{"apple", "orange"}] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #MATLAB_.2F_Octave | MATLAB / Octave | length({'apple', 'orange'}) |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #APL | APL | ∇res ← integer_arithmetic; l; r
l ← ⎕
r ← ⎕
res ← 6 2 ⍴ 'sum' (l+r) 'diff' (l-r) 'prod' (l×r) 'quot' (⌊l÷r) 'rem' (r|l) 'pow' (l*r)
∇ |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #AppleScript | AppleScript | set i1 to (text returned of (display dialog "Enter an integer value" default answer "")) as integer
set i2 to (text returned of (display dialog "Enter another integer value" default answer "")) as integer
set sum to i1 + i2
set diff to i1 - i2
set prod to i1 * i2
set quot to i1 div i2 -- Rounds towards zero.
set rema... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Mercury | Mercury | :- module array_length.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module array, list.
main(!IO) :-
Array = array(["apples", "oranges"]),
io.write_int(size(Array), !IO). |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #min | min | ("apple" "orange") size print |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #ARM_Assembly | ARM Assembly |
/* ARM assembly Raspberry PI */
/* program arith.s */
/* Constantes */
.equ STDOUT, 1
.equ WRITE, 4
.equ EXIT, 1
/***********************/
/* Initialized data */
/***********************/
.data
szMessError: .asciz " Two numbers in command line please ! \n" @ message
szRetourLigne: .asciz "\n"... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #MiniScript | MiniScript |
fruits = ["apple", "orange"]
print fruits.len
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #MiniZinc | MiniZinc |
array[int] of int: arr = [1,2,3];
var int: size = length(arr);
solve satisfy;
output [show(size),"\n"];
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Arturo | Arturo | a: to :integer input "give me the first number : "
b: to :integer input "give me the second number : "
print [a "+" b "=" a+b]
print [a "-" b "=" a-b]
print [a "*" b "=" a*b]
print [a "/" b "=" a/b]
print [a "%" b "=" a%b]
print [a "^" b "=" a^b] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Nanoquery | Nanoquery | fruit = array(2)
fruit[0] = "apple"
fruit[1] = "orange"
println len(fruit)
// outputs 2 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Neko | Neko | var fruit = $array("apple", "orange");
$print($asize(fruit)); |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Asymptote | Asymptote | int a = -12;
int b = 7;
int suma = a + b;
int resta = a - b;
int producto = a * b;
real division = a / b;
int resto = a % b;
int expo = a ** b;
write("Siendo dos enteros a = -12 y b = 7");
write(" suma de a + b = ", suma);
write(" resta de a - b = ", resta);
write(" producto de a * b = ", producto);
wr... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #NewLISP | NewLISP | (println (length '("apple" "orange")))
; Nehal-Singhal 2018-05-25
(length '(apple orange)) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #NGS | NGS | echo(len(['apple', 'orange']))
# same
echo(['apple', 'orange'].len()) |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #AutoHotkey | AutoHotkey | Gui, Add, Edit, va, 5
Gui, Add, Edit, vb, -3
Gui, Add, Button, Default, Compute
Gui, Show
Return
ButtonCompute:
Gui, Submit
MsgBox,%
(Join`s"`n"
a "+" b " = " a+b
a "-" b " = " a-b
a "*" b " = " a*b
a "//" b " = " a//b " remainder " Mod(a,b)
a "**" b " = " a**b
)
; fallthrough
GuiClose:
ExitA... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Nim | Nim | let fruit = ["apple", "orange"]
echo "The length of the fruit array is ", len(fruit) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Oberon-2 | Oberon-2 |
MODULE ArrayLength;
IMPORT
Strings,
Out;
TYPE
String = POINTER TO ARRAY OF CHAR;
VAR
a: ARRAY 16 OF String;
PROCEDURE NewString(s: ARRAY OF CHAR): String;
VAR
str: String;
BEGIN
NEW(str,Strings.Length(s) + 1);COPY(s,str^);
RETURN str
END NewString;
PROCEDURE Length(a: ARRAY OF String): LONGINT;
VAR... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Avail | Avail | Method "arithmetic demo_,_" is
[
a : integer,
b : integer
|
Print: “a + b”;
Print: “a - b”;
Print: “a × b”; // or a * b
Print: “a ÷ b”; // or a / b, rounds toward negative infinity
Print: “a mod b”; // sign matches second argument
Print: “a ^ b”;
];
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Objeck | Objeck |
class Test {
function : Main(args : String[]) ~ Nil {
fruit := ["apples", "oranges"];
fruit->Size()->PrintLine();
}
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #OCaml | OCaml |
Array.length [|"apple"; "orange"|];;
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #AWK | AWK | /^[ \t]*-?[0-9]+[ \t]+-?[0-9]+[ \t]*$/ {
print "add:", $1 + $2
print "sub:", $1 - $2
print "mul:", $1 * $2
print "div:", int($1 / $2) # truncates toward zero
print "mod:", $1 % $2 # same sign as first operand
print "exp:", $1 ^ $2
exit } |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Oforth | Oforth | [ "apple", "orange" ] size |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Ol | Ol |
(print (vector-length (vector "apple" "orange")))
(print (vector-length #("apple" "orange")))
(print (vector-length ["apple" "orange"]))
(print (size #("apple" "orange")))
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #BASIC | BASIC | ' Arthimetic/Integer
DECLARE a%, b%
INPUT "Enter integer A: ", a%
INPUT "Enter integer B: ", b%
PRINT
PRINT a%, " + ", b%, " is ", a% + b%
PRINT a%, " - ", b%, " is ", a% - b%
PRINT a%, " * ", b%, " is ", a% * b%
PRINT a%, " / ", b%, " is ", a% / b%, ", trucation toward zero"
PRINT "MOD(", a%, ", ", b... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Onyx | Onyx | [`apple' `orange'] length # leaves 2 on top of the stack |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #ooRexx | ooRexx |
/* REXX */
a = .array~of('apple','orange')
say a~size 'elements'
Do e over a
say e
End
Say "a[2]="a[2] |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #BASIC256 | BASIC256 |
input "enter a number ?", a
input "enter another number ?", b
print "addition " + a + " + " + b + " = " + (a + b)
print "subtraction " + a + " - " + b + " = " + (a - b)
print "multiplication " + a + " * " + b + " = " + (a * b)
print "integer division " + a + " \ " + b + " = " + (a \ b)
print "remainder or modulo " ... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Batch_File | Batch File |
set /p equation=
set /a result=%equation%
echo %result%
pause
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #PARI.2FGP | PARI/GP | array = ["apple", "orange"]
length(array) \\ == 2
#array \\ == 2 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Pascal | Pascal |
#!/usr/bin/instantfpc
//program ArrayLength;
{$mode objfpc}{$H+}
uses SysUtils, Classes;
const
Fruits : array[0..1] of String = ('apple', 'orange');
begin
WriteLn('Length of Fruits by function : ', Length(Fruits));
WriteLn('Length of Fruits by bounds : ', High(Fruits) - Low(Fruits) + 1);
END.
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #BBC_BASIC | BBC BASIC | INPUT "Enter the first integer: " first%
INPUT "Enter the second integer: " second%
PRINT "The sum is " ; first% + second%
PRINT "The difference is " ; first% - second%
PRINT "The product is " ; first% * second%
PRINT "The integer quotient is " ; first% DIV second% " (rounds toward... |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #bc | bc | define f(a, b) {
"add: "; a + b
"sub: "; a - b
"mul: "; a * b
"div: "; a / b /* truncates toward zero */
"mod: "; a % b /* same sign as first operand */
"pow: "; a ^ b
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Perl | Perl | my @array = qw "apple orange banana", 4, 42;
scalar @array; # 5
0 + @arrray; # 5
'' . @array; # "5"
my $elems = @array; # $elems = 5
scalar @{ [1,2,3] }; # [1,2,3] is a reference which is already a scalar
my $array_ref = \@array; # a reference
scalar @$array_ref;
# using subroutine prot... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Phix | Phix | constant fruits = {"apple","orange"}
?length(fruits)
|
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #Befunge | Befunge | &&00p"=A",,:."=B ",,,00g.55+,v
v,+55.+g00:,,,,"A+B="<
>"=B-A",,,,:00g-.55+,v
v,+55.*g00:,,,,"A*B="<
>"=B/A",,,,:00g/.55+,v
@,+55.%g00,,,,"A%B="< |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Phixmonti | Phixmonti | "apple" "orange" stklen tolist len print |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #PHP | PHP | print count(['apple', 'orange']); // Returns 2 |
http://rosettacode.org/wiki/Arithmetic/Integer | Arithmetic/Integer |
Basic Data Operation
This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:
Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |... | #BQN | BQN | •Out "Enter number 1: "
a ← •BQN •GetLine @
•Out "Enter number 2: "
b ← •BQN •GetLine @
•Show a + b
•Show a - b
•Show a × b
•Show a ÷ b
•Show b | a
•Show a ⋆ b |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Picat | Picat | main =>
L = ["apple", "orange"],
println(len(L))),
println(length(L)),
println(L.len),
println(L.length). |
Subsets and Splits
Select Specific Languages Codes
Retrieves specific programming language names and codes from training data, providing basic filtering but limited analytical value beyond identifying these particular languages.