Friday, February 19, 2010

Creating a program to Determine the Given Number is either Negative, Zero or Positive

Here is the program to Determine the Given Number is either Negative, Zero or Positive

Code
10 Cls
20 REM TO find the Given Number is -VE, 0 or +ve
30 input "enter a Number"; N
40 A$= "Negative"
50 B$="Zero"
60 C$= "Positive"
70 D$= "The Number is "
80 S=SGN(N)+2
90 On S GOTO 100, 110, 120
100 Print D$; A$ : End 
110 Print D$; B$ : END
120 Print D$; C$ : end
130 End

Output

Enter the number? 4
The Number is Positive

0 comments:

  © Blogger template 'A Click Apart' by Ourblogtemplates.com 2008

Back to TOP