answersLogoWhite

0


Best Answer

echo "Enter A Number :"

read n

r=n

s=0

rem=0

while [ $n -gt 0 ]

do

rem=$(($n%10))

s=$(($s+$rem*$rem*$rem))

n=$(($n/10))

done

if [ $r -eq $s ]

then

echo "The Number is Avogadro"

else

echo "The Number is Not Avogadro"

fi

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Shell program to find out whether given number is Avogadro or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a shell programs for to check whether the given number is an Avogadro number or not?

Avogadro's number is a constant. Therefore only one number is equal to Avogadro's number.


write a shell program to find out the avogadro number?

cho "Enter A Number :" read n r=n s=0 rem=0 while [ $n -gt 0 ] do rem=$(($n%10)) s=$(($s+$rem*$rem*$rem)) n=$(($n/10)) done if [ $r -eq $s ] then echo "The Number is Avogadro" else echo "The Number is Not Avogadro" fi


What is a shell script to print Avogadro's number?

#!/bin/sh echo "6.0221415 * 10²³" #!/bin/sh echo "6.0221415 * 10 ^ 23"


Write a Shell program to find the smallest number from a set of numbers?

k


Shell program to find the smallest digit of a given number?

syntax error


Write a shell program using if-the-else to test whether a variable name is a directory or a file?

see : Write_a_shell_program_using_the_if-the-else_to_test_whether_a_variable_name_is_a_directory_or_a_file


Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


How do you find whether a given number is even or odd in Unix shell programming?

echo "Program to check even or odd number"echo "Enter a number"read na=`expr $n % 2`if [ $a -eq 0 ] ; then #Semicolon is most important for Executing ifelse statementsecho "It is an even number"elseecho "It is an odd number"fi


Shell program to find the sum of cube of individual digits of a number?

Shell problems are programs that can be run to find out information about numbers. The problem can help find an even or odd number, or what the sum of a cube is.


Does the number of electrons in the innermost shell of an atom determine whether the atom has high or low reactivity?

Only in hydrogen or helium, because in these two elements only the innermost shell is also the outermost shell.


Write a program in shell script to display odd number from 0 to 100?

seq 1 2 99


Shell program to generate prime number between 1 and 50?

There are several shell programs available for download on the Internet that will generate prime numbers. The best way to find a prime number is through calculation, however.