Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Q1)

mano quei.sh

a+X quei.sh

quei.sh

whoami

Q2)

nano que2.sh

./que2.sh

Friday 09 December 2022 10:50:23 PM IST

nano que2.sh

./que2.sh
Q3)

echo –n “Enter name”

read name

if [ -d $ same]

then

echo “content are”

ls –a $name

elif [ -f $name]

then

echo “size is”

wc –c $name

else

echo “does not exit”

./que3.sh

./que3.sh

./que3.sh
Q4)

echo –n “enter no”

read n

for ((i=2; i<5n/2; i++))

do

ans=$((n%i))

if[$ans –eq 0]

then

echo “not prime”

exit O

fi

done

echo “$n is prime”


Q5)

Echo –n “enter n1”

Read n1

Echo –n “enter n2”

Read n2

Echo –n “enter n3”

Read n3

If [$n1 –get $ n2 ]&&[$n2 –get $n3]

then

echo"$n1 is the greatest."

Elif [$n2 –get $ n2 ]&&[$n2 –get $n3]

then

echo"$n2 is the greatest."

else

"$n3 is the greatest."

F1

Q6)

Echo –n "Enter year:”

Read leap

If [expr $leap % 4 eq 0]

Then

echo"$leap is Leap Year."

else
"$leap is not leap year."

F1

Q7)

Echo –n "Enter radius”

Read r

Pi=3.14

A=$(echo”(e*pi*$r)”|bc)

Echo –n”area is $a”

Q8)

Echo -n

Echo “Enter lenght:”

Read l

Echo “Enter width:”

Read w

a=$[$l*$w]

echo –n “Area of Rectangle is $a”


Q9)

echo –n “Echo “Enter lenght:”

read n

if[$n –lt 0]

then

echo “$n is postive”

elseif[$n –gt 0]

echo “$n is postive”

then echo “no is not positive not negative”

f1
Q10)

11
12

13

14
15

16

Q18) Print the following pattern.

*
**
***
****
*****
17

18

You might also like