Computer Science, asked by sindhubhee, 2 months ago

#!/bin/bash n2=2 n2=5 echo exprn1+n2 what is the out put​

Answers

Answered by gnulinuxbsduser
0

Answer:

The output of this bash program is 7

Explanation:

#!/bin/bash

this thing at the top is know as shebang. this sets the interpreter to bash

n1 & n2

these are the variables

expr

expr evaluates expressions which is n1 and n2 in our case for more information read the man page of expr `man expr`

btw here's the correct syntax of the program

#!/bin/bash

n1=2

n2=5

echo "the sum of n1 and n2 is ->\n"

expr $n1 + $n2

Similar questions