Using the ________ keyword before a function suggests to the compiler that the function should be expanded at the point where it is called.
- Dynamic
- Inline
- Static
- Virtual
The "inline" keyword suggests to the compiler that the function should be expanded at the call site for performance optimization.
What is the significance of the SEEK_SET, SEEK_CUR, and SEEK_END constants in file handling?
- File attributes
- File permissions
- File positioning
- File type
In file handling, the SEEK_SET, SEEK_CUR, and SEEK_END constants are used to define the reference point for file positioning. SEEK_SET sets the file position from the beginning of the file, SEEK_CUR sets it relative to the current position, and SEEK_END sets it relative to the end of the file. These constants are crucial for accurate file positioning and seeking within files.
In C, to close a file opened by fopen, the function ________ is used.
- close
- fclose
- fflush
- remove
In C, the fclose function is used to close a file that was opened with fopen. It's essential to free resources and ensure data is written.
When working with large datasets, using pointers to structures can help in reducing ________ overhead.
- Computational
- Memory
- Processing
- Storage
Pointers to structures in C can help reduce memory overhead, as they allow for more efficient memory management and allocation, especially when dealing with large datasets.
The ________ function is used to move the file pointer to a specified position in a file.
- moveptr()
- fseek()
- setposition()
- positionfile()
The correct option is b) fseek(). This function in C is used to move the file pointer to a specified position in the file. It takes the file pointer, offset, and origin as arguments.
The function ________ is used to copy one string to another in C.
- compare()
- length()
- strcpy()
- swap()
In C, the function strcpy() is used to copy one string to another. It takes two string arguments and copies the contents of the source string to the destination string until it encounters a null character.
Which sorting algorithm is most efficient when dealing with small datasets or partially sorted data?
- Bubble Sort
- Insertion Sort
- Merge Sort
- Quick Sort
Insertion Sort is efficient for small datasets and partially sorted data due to its simplicity and low overhead.
What is the purpose of an array in C?
- To create functions
- To perform arithmetic operations
- To store a single value
- To store multiple values of the same data type
The purpose of an array in C is to store multiple values of the same data type in a contiguous memory block, making it easier to work with collections of data.
In Pandas, which function is used to read a CSV file into a DataFrame?
- read_excel
- load_csv
- read_csv
- import_data
The correct function is read_csv. This Pandas function is specifically designed to read data from CSV files and create a DataFrame, making it a fundamental tool for data manipulation in Python. read_excel is used for Excel files, and the other options are not valid Pandas functions for this purpose.
To group data by a specific column and perform aggregate functions in Pandas, use the _______ method.
- aggregate
- groupby
- pivot
- summarize
In Pandas, the groupby method is used to group data by a specific column or columns. This allows you to perform aggregate functions on each group, such as sum, mean, or count. The aggregate method is used after grouping to apply various aggregate functions.