answersLogoWhite

0

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

12y ago

What else can I help you with?

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 to find the sum of cube of individual digits of a number?

no thanks


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


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.


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


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.


What is the difference between effective valence electron and outer shell count?

Number of electrons in outer shell determines thechemical nature of the element and is unique per element. Effective Valence electrons is a calculated ratio between two concentrations of electrons. if n=resisitivity/(e*driftMobility) and n_at=density*Avogadro#/AtomicMass. Effective valence electrons is then n/n_at. Rounding this number should agree with outer shell electrons as predicted from the periodic table.


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

seq 1 2 99