RSS Forums RSS

Avogadro Number

Please support our Shell Scripting advertiser: Programming Forums
Reply
Posts: 7
Reputation: man5237 is an unknown quantity at this point 
Solved Threads: 0
man5237 man5237 is offline Offline
Newbie Poster

Avogadro Number

  #1  
Oct 8th, 2008
Shell program to check whether a given number is avogadro number or not.
AddThis Social Bookmark Button
Reply With Quote  
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Avogadro Number

  #2  
Oct 8th, 2008
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
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote  
Posts: 7
Reputation: man5237 is an unknown quantity at this point 
Solved Threads: 0
man5237 man5237 is offline Offline
Newbie Poster

Re: Avogadro Number

  #3  
Oct 9th, 2008
Just determine.

That's all.
Reply With Quote  
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Avogadro Number

  #4  
Oct 10th, 2008
Hey There,

Here's one way to do it:

#!/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:

$ ./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
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote  
Posts: 7
Reputation: man5237 is an unknown quantity at this point 
Solved Threads: 0
man5237 man5237 is offline Offline
Newbie Poster

Re: Avogadro Number

  #5  
Oct 10th, 2008
Thanks
Reply With Quote  
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Avogadro Number

  #6  
Oct 10th, 2008
No problem. Glad to help

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Shell Scripting Forum
Views: 1243 | Replies: 5 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:22 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC