Question

    What is the primary use of the printf function in C/C++

    programming?
    A To allocate memory dynamically during program execution. Correct Answer Incorrect Answer
    B To perform input operations from the standard input device, such as the keyboard. Correct Answer Incorrect Answer
    C To print formatted output to the standard output device, usually the console. Correct Answer Incorrect Answer
    D To define and declare variables within a program. Correct Answer Incorrect Answer
    E To compile source code into machine code for execution. Correct Answer Incorrect Answer

    Solution

    The printf function is used in C and C++ programming to output formatted text to the standard output device, which is typically the console or terminal. This function allows programmers to display text, numbers, and other data types in a specified format, which is essential for generating readable output and debugging.

    Practice Next