InterviewSolution
Saved Bookmarks
| 1. |
Question1 a)State two differences between pure and impure functions? b) State the difference between the functions length and length() ? c)Give the prototype of a function which receives a character ch and an integer n and returns true or false.d)if int n[]=(1,2,3,5,7,9,13,16); What are the values of x and y? x=Math.pow(n[4],n[2]);y=Math.sqrt(n[5] +n[7]);e) Rewrite the following program segment using if-else statement comm. (sale>=50000)?sale *10/100: 0; |
| Answer» PURE functions take objects and/or primitive data TYPES as ARGUMENTS but does not modify the objects. Impure functions change the state of received objects. Pure functions doesn't have SIDE effects. Impure functions have side effects. | |