Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM 7al el mo3adla el tarbee3iya
- 10 INPUT "Enter a,b,c in ax²+bx+c=0 ?"; a,b,c
- if a = 0 then
- print "Co-effecient of x² can't be 0, try again."
- print 'satr fady
- goto 10
- end if
- momayez = b^2 - 4 * a * c
- if momayez >= 0 then ' Di el 7ala el 3adiya
- x1 = (-1*b + momayez^.5) / (2 * a)
- x2 = (-1*b - momayez^.5) / (2 * a)
- print "Real square roots are: "; x1,x2
- else ' law el gzoor morakaba
- momayez = momayez*-1 'me3iar el momayez
- awel7ad = -1*b / (2 * a) 'el goz2 el 7aqeeqy
- tany7ad = momayez^.5 / (2 * a) 'el goz2 el ta5ayoly men 5eer el i
- print "Complex square roots are: "; awel7ad;"±";tany7ad;"i"
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement