PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.2
Code Block Pro – Beautiful Syntax Highlighting v1.27.2
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / ballerina.sample

ballerina.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.2, at build/shiki/samples/ballerina.sample

32 lines 692 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import ballerina/io;
2
3 // This function definition has two parameters of type `int`.
4 // `returns` clause specifies type of return value.
5 function add(int x, int y) returns int {
6
7 int sum = x + y;
8 // `return` statement returns a value.
9 return sum;
10
11 }
12
13 public function main() {
14 io:println(add(5, 11));
15 }
16 import ballerina/io;
17
18 // This function definition has two parameters of type `int`.
19 // `returns` clause specifies type of return value.
20 function add(int x, int y) returns int {
21
22 int sum = x + y;
23 // `return` statement returns a value.
24 return sum;
25
26 }
27
28 public function main() {
29 io:println(add(5, 11));
30 }
31
32 // From https://ballerina.io/learn/by-example/functions