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
Avogadro's number is a constant. Therefore only one number is equal to Avogadro's 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
#!/bin/sh echo "6.0221415 * 10²³" #!/bin/sh echo "6.0221415 * 10 ^ 23"
k
syntax error
see : Write_a_shell_program_using_the_if-the-else_to_test_whether_a_variable_name_is_a_directory_or_a_file
no thanks
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 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.
Only in hydrogen or helium, because in these two elements only the innermost shell is also the outermost shell.
seq 1 2 99
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.