Write a shell script to check whether a number is Armstrong number or not?
Answer / kirtiranjan sahoo
read -p "Enter any number : " no
rev=0
temp=$no
while [ $no -ne 0 ]
do
dig=$(( $no%10 ))
rev=$(( $rev+$dig*$dig*$dig ))
no=$(( $no/10 ))
done
if [ $rev -eq $temp ]
then
echo "Armstrong"
else
echo "Not Armstrong"
fi
| Is This Answer Correct ? | 26 Yes | 23 No |
What are zombie processes?
What is shell and terminal?
Write a command sequence to find the count of each word?
What does sh mean?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
How do I save a powershell script?
What does $@ mean in shell?
How many prompts are available in a UNIX system?
How to find duplicate record in file using shell script?
0 Answers IBM, Saama Tech, Wipro,
What is c in shell script?
What are the two files of crontab command?
What is gui scripting?