Question and Answers Forum

All Questions      Topic List

Algebra Questions

Previous in All Question      Next in All Question      

Previous in Algebra      Next in Algebra      

Question Number 46738 by Umar last updated on 30/Oct/18

please help    Write an algorithm that will find  the solution of the equation            f(x)= { ((−x, when x<0)),((x,     when x≥0)) :}

pleasehelp Writeanalgorithmthatwillfind thesolutionoftheequation f(x)={x,whenx<0x,whenx0

Commented byhassentimol last updated on 31/Oct/18

I think it may be this :     ask for x     if x< 0 :         return −x     else :        return x    I also think it would be like that on python :  x = float(input(′′value of x ?′′))  if (x<0) :      print ((−1)∗x)  else :      print(x)

Ithinkitmaybethis: askforx ifx<0: returnx else: returnx Ialsothinkitwouldbelikethatonpython: x=float(input(valueofx?)) if(x<0): print((1)x) else: print(x)

Commented byUmar last updated on 31/Oct/18

thank you sir

thankyousir

Terms of Service

Privacy Policy

Contact: info@tinkutara.com