Tech Mahindra interview question

1. Explain the difference between #include and #include "file". The key distinction between #include and #include "file" is basically the search location for the preprocessor include file. The preprocessor searches the same directory as similar to #include "file" directive file. This method is often used to include programmatically generated header files. The preprocessor, on the other hand, looks for #include in search directories specified by the Integrated Development Environment (IDE) or compiler, which may or may not be in the same directory like the directive's file. This particular method is typically used to include standard library header files. 2. Explain the difference between call by reference and call by value? Before moving forward to look at the differences between call by reference and call by value, let us know the definitions of them: Call by Reference: Here, both the formal and actual parameters relate to the same place; thus, any modifications made within the function are mirrored in the actual parameters of the caller. Call by Value: The principles of actual parameters are transferred to the formal parameters in this parameter passing method, and two kinds of parameters are kept in distinct memory locations. Consequently, any modifications performed within functions are not mirrored in the actual parameters passed to the caller.