Question

    What is the purpose of the #include directive in C/C++ programming?

    A To include the standard definitions for input and output functions, such as printf and scanf. Correct Answer Incorrect Answer
    B To define the standard libraries for mathematical operations, such as sqrt and pow. Correct Answer Incorrect Answer
    C To provide the standard data types and constants used for memory management. Correct Answer Incorrect Answer
    D To include the header files necessary for network programming and socket operations. Correct Answer Incorrect Answer
    E To include definitions for graphical user interface (GUI) components and functions. Correct Answer Incorrect Answer

    Solution

    The #include directive in C and C++ is used to include the Standard Input Output library header file in a program. This header file contains the declarations of functions for performing input and output operations, such as printf for output and scanf for input. By including , a program gains access to these standard I/O functions, allowing it to interact with the user through the console or terminal.

    Practice Next