0

CHALLENGE

I want to make a software which takes two inputs 1.A function 2.A value and gives output of that function with the value EXAMPLE INPUT 1-> sin(x+cos(x)) INPUT 2 -> 90 OUTPUT 1 AS sin(90+cos(90))=1

26th Mar 2018, 1:32 PM
Biswajit patra
Biswajit patra - avatar
3 Respuestas
26th Mar 2018, 2:21 PM
Vivek Sivaramakrishnan
Vivek Sivaramakrishnan - avatar
0
please ANSWER IT
26th Mar 2018, 1:33 PM
Biswajit patra
Biswajit patra - avatar
- 1
If you add function like that in the parameter you will get error "x is not defined". Before the script executes the actual function it tries to execute sin(x+cos(x)) which is not possible because variable x doesn't exist. If you want to use function as parameter you can't call it. It should be something like this. call(sin, 90);
26th Mar 2018, 1:54 PM
Toni Isotalo
Toni Isotalo - avatar