Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
The problem statement, all variables and given/known data:
The object is to enter a number, then have another classmate guess the entered number.
Relevant commands, code, scripts, algorithms:
I am trying to use an if-then-else statement to accomplish my goal
The attempts at a solution (include all code and scripts):
#! /bin/csh
echo "Please select a number to be guessed"
read num1
1:
echo "Please guess a number"
read num2
if (num2 == num1) then
echo "Congratulations!! You have guessed correctly!"
else
echo "Sorry, but that number is incorrect."
goto 1
endif
Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Washtenaw Community College, Ann Arbor MI, USA, Doug Cox, CIS 121
<Hoping I did the template correctly>
The problem I am encountering is that no matter what number I enter, it always echos "Sorry, but that number is incorrect" even if I enter, say 11, for both num1 and num2. And yes, I am a complete coding noob. xD
What shell would you recommend doing this in? I dont think there are any requirements as to what shell to use. Are there any that might be better suited for my needs?