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 |
how did u debugging in unix/ linux platform ??( project Related)
Is shell a scripting language?
write a shell script to check whether all the directories in the path exist has read and write permission
What is a file basename?
What are the different methods available to run a shell script?
What is the use of break command?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
I want to connect to a remote server and execute some commands, how can I achieve this?
How do I set bash as default shell mac?
What are the different types of shell scripting?
is this growing field and what is average package in this?
What is basename in shell script?