

InterviewSolution
Saved Bookmarks
1. |
Explain with example Pure and impure functions. |
Answer» The only result of calling a pure function is the return value. EXAMPLES of pure functions are strlen(), pow(), sqrt() etc. Examples of impure functions are printf(), rand(), time(), etc. If a function is known as pure to COMPILER then Loop OPTIMIZATION and subexpression ELIMINATION can be applied to it. |
|