TIDE
Languages

bc

Installing GNU bc on Ubuntu in TIDE

bc

GNU bc (Basic Calculator) is an arbitrary-precision numeric processing language and interactive algebraic environment widely used in Linux shell scripting and command-line calculation.

Installation

Install bc via the Ubuntu package manager:

apt update
apt install -y bc

Verification

Verify bc installation:

bc --version

Writing and Executing Code

Create a bc script named hello.bc:

print "Hello, World!\n"
scale = 10
4 * atan(1)
quit

Execute the script with bc:

bc -l hello.bc

Alternatively, run an inline command:

echo 'print "Hello, World!\n"' | bc

Official Resources

On this page