Click or drag to resize

Input and output functions

GoManga MathStudio Language offers built-in functions to do Input and Output operations.

Input

To input the value of a variable, you just have to put the input keyword after the assignament. For example:

//Input a variable
[InVar] = input
Output

There are two ways to output a variable. The output function will output the given string to a new line, while the outputl function will output the given string to the current line. For instance:

output Hello world
outputl !
//The code will output the "Hello World!" string on the same line

//Strings operations:
output Hello
output World
//in this case the code will output the string below:
// 
//Hello
//World

To output a variable value, just refer to its value with braces:

[a] = input
[b] = input

[sum] = calc {a} + {b}
output {a} + {b} = {sum}

pause
//(Pause the execution)

//If you give 5 and 9 as input, the code will return:
// 
//5 + 9 = 14