Q. How do I write Bash Script to find Armstrong number Ans: #!/bin/bash #Script to find armstrong number till 500, you can change it i=1 whi...Read more »
The Magician Of Linux
Q. How do I write Bash Script to find Armstrong number Ans: #!/bin/bash #Script to find armstrong number till 500, you can change it i=1 whi...Read more »
Q. How do I swap two numbers without using addition and subtraction in Bash Ans: #!/bin/bash read -p "Enter first number :" first ...Read more »
Q. How do I write shell script to find Smallest and Greatest number in an array Ans: #!/bin/bash echo "enter size of an array" rea...Read more »
Q. How do I write Bash Script to add two numbers using function Ans: #!/bin/bash #function to add two numbers add() { x=$1 y=$2 echo -e ...Read more »
Q. How to use array in Bash for taking input and displaying it Ans: #!/bin/bash for((i=0;i do echo "enter `expr $i + 1` number" re...Read more »
Q. How do I add command line arguments in Bash Ans: #!/bin/bash if [ $# -ne 2 ] ; then echo -e " please provide correct number of argu...Read more »
Q. How do I write Shell Script to find Greatest of Three Numbers by If-else statement Ans: #!/bin/bash echo "enter first number" r...Read more »
Q. How do I write Shell Script to find leap year Ans: #!/bin/bash echo -e "enter year " read year #if year is less than or equal t...Read more »
Q. How do I write Shell Script to find Sum of digits of a Number Ans: #!/bin/bash echo -e "enter the number" read n sum=0 a=$n whi...Read more »
Q. How do I write Shell Script to find factorial of a number Ans: #!/bin/bash fact=1 #taking input from user echo -e "enter a number...Read more »