1834662 Members
2845 Online
110069 Solutions
New Discussion

hai can anyone help me ?

 
imang
New Member

hai can anyone help me ?

answer this problem solving please
1.) write an if statement that sets the variable num to 1 when choice equals 10.

2.) if statement that sets the variable num to the same value as the control variable choice when choice equals 5, but sets num to 0 in every other case.

thanx.. rili rili apriciate ur kindnes
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: can anyone help me?

You seem to be asking simple shell programming questions.
if [ $choice -eq 10 ]; then
    num=1
fi
if [ $choice -eq 5 ]; then
    num=$choice # which is 5
else
    num=0
fi

kobylka
Valued Contributor

Re: hai can anyone help me ?

Script is attached.

Where does variable ``choice'' come from? Command line, terminal, file input, ...?

Regards,

Kobylka
Steven Schweda
Honored Contributor

Re: hai can anyone help me ?

> thanx.. rili rili apriciate ur kindnes

One might argue that doing a child's homework
for him is not really a kindness.