Which of the following function is more appropriate for reading in a multi-word string? ans. scanf() printf() gets() puts()

Question

Which of the following function is more appropriate for reading in a multi-word string? ans. scanf() printf() gets() puts()
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

The most appropriate function for reading in a multi-word string in C is gets().

Here's why:

  1. scanf(): This function reads the input from the user until it encounters a whitespace. So, it's not suitable for multi-word strings.

  2. printf(): This function is used to print the output, not t Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob

Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv

This problem has been solved

Similar Questions

Which of the following function is more appropriate for reading in a multi-word string? ans. scanf() printf() gets() puts()

Which of the following function is more appropriate for reading in a multi-word string? gets() puts() scanf() printf()

Which of the following function is more appropriate for reading in a multi-word string? ans. gets() puts() printf() scanf()

Which of the following function is more appropriate for reading in a multi-word string?ans.puts()scanf()gets()printf() Previous Marked for Review Next

Which of the following function is more appropriate for reading in a multi-word string?

1/3