0
Though i put same value in both case sqr(4),sqr(3+1) it prints different values why?
2 odpowiedzi
+ 3
If you enter two numbers like sqr(a+b) it is giving output according to formula 2*a+b. If you want to get sqr(4) and sqr(3+1)'s out as their original squares then you should use sqr((3+1)) . In this it first does the part in bracket so one one input is given to sqr() function.
+ 1
Define acts like copy and paste.
sqrt(4) = 4*4 = 16
sqrt(3+1) = 3+1*3+1 = 3 + 3 + 1 = 7
To make sqrt(4)==sqrt(3+1) true, the definition should be (x)*(x) (with brackets)