Shell program to check whether a given number is avogadro number or not.
man5237
0
Newbie Poster
Recommended Answers
Jump to PostHey 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 …
Jump to PostHey There,
Here's one way to do it:
#!/bin/bash
echo -n "Enter your number: "
read answerif [ "$answer" == "6022000000000000000000000" ]
then
echo "You picked the Avogadro Number! $answer"
else
echo "That number isn't the Avogadro Number!"
fiOutput:
All 5 Replies
eggi
92
Posting Whiz
man5237
0
Newbie Poster
eggi
92
Posting Whiz
man5237
0
Newbie Poster
eggi
92
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.