answersLogoWhite

0


Best Answer

Use "bc". For example:-

[irb@eddie ~]$ echo "1 + 2 + 3 + 4" | bc

10

[irb@eddie ~]$

Use "man bc" to learn more about this calculator program.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a shell script to perform arithmetic operation such as input1234 and output10?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the functions of arithmetic logic unit?

The Arithmetic Logic Unit as suggested by the name carries out the arithmetic calculations of the computer.


Is it true the arithmetic operator directs excel to perform the division operation?

true


What arithmetic operator directs Excel to perform the division operation?

the divide symbol (/)


How an ALU differentiate between arithmetic and logic?

It doesn't have to. The ALU is given one or two inputs and is told what operation to perform on them. It has no need to figure out whether that operation is arithmetic or logic, since each individual operation will be different anyway.


Which are the possibe arithmetic operation with pointers?

Pointers in C are stored as integers. You can perform any mathematical operations on pointers that you can perform on ints.Of course not, the following operations are possible: =, +, +=, ++, -, -=, --, *, [], ->, typecast


What was mathematical operation was stepped reckoner supposed to perfrom?

It was the first calculator that could perform all four arithmetic operations: addition, subtraction, multiplication and division.


What is an accumulator in microprocessor?

the accumulator is an 8-bit register then is part of the arithmetic/logic unit(ALU). this register is used to store to store 8-bit data and to perform arithmetic & logical operation. the result of an operation is stored in the accumulator. the accumulator is also identified as register A.


How do you perform arithmetic operations on binary numbers?

There are a few rules to perform arithmetic operations in binary numbers. According to those rules you can add or subtract binary numbers. There are only two arithmetic operations used in binary numbers, they are addition and subtraction.


How do you perform operation in scientific notation?

The answer will depend on what operation you have in mind.


Which unit of computer performs arithmetic and logical functions?

The ALU (arithmetic logic unit) An ALU loads data from input registres, an external Control Unit then tells the ALU what operation to perform on that data, and then the ALU stores its result into an output register. Other mechanisms move data between these registers and memory.


What are the operations that are done by Arithmetic and Logic Unit?

The operation of ALU are: addition, multiplication,comparing,complement(subtraction),exclusive OR, increment, decrement, and bit-shifting. Notably, ALUs perform only INTEGER operations, not Floating Point operations.


Which part of CPU perform logical function?

ALU-Arithmetic and logic unit.