943,879 Members | Top Members by Rank

Ad:
Oct 9th, 2008
0

Avogadro Number

Expand Post »
Shell program to check whether a given number is avogadro number or not.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
man5237 is offline Offline
7 posts
since Apr 2008
Oct 9th, 2008
0

Re: Avogadro Number

Hey there,

Did you want to do some calculation against the constant or just determine if a number is avogadro's number or not? If so, all you have to do is test whether or not the number equals the number (6.022 x 10 to the 23rd power).

I'm probably missing something. If you could explain further, maybe I can help.

Best wishes,

Mike
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007
Oct 9th, 2008
0

Re: Avogadro Number

Just determine.

That's all.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
man5237 is offline Offline
7 posts
since Apr 2008
Oct 10th, 2008
0

Re: Avogadro Number

Hey There,

Here's one way to do it:

Quote ...
#!/bin/bash

echo -n "Enter your number: "
read answer

if [ "$answer" == "6022000000000000000000000" ]
then
echo "You picked the Avogadro Number! $answer"
else
echo "That number isn't the Avogadro Number!"
fi
Output:

Quote ...
$ ./av.sh
Enter your number: 3120280138
That number isn't the Avogadro Number!

$ ./av.sh
Enter your number: 6022000000000000000000000
You picked the Avogadro Number! 6022000000000000000000000
Hope that helps

, Mike
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007
Oct 10th, 2008
0

Re: Avogadro Number

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
man5237 is offline Offline
7 posts
since Apr 2008
Oct 11th, 2008
0

Re: Avogadro Number

No problem. Glad to help

, Mike
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Downloading attachments from an email through a shell script.
Next Thread in Shell Scripting Forum Timeline: PR Jobs





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC