Select the correct and safe ways to read a string with spaces from the user at the runtime and store it in character array of length 20 * .(character (name fgets( name, 21, stdin); fgets("%19s",name,stdin); fgets(name, 19, stdin); scanf("%19s", name); scanf("%s", name); scanf("%19s", &name);

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question
Select the correct and safe ways to
read a string with spaces from the
user at the runtime and store it in
character array of length 20
.(character (name
fgets( name, 21, stdin);
fgets("%19s",name,stdin);
fgets(name, 19, stdin);
scanf("%19s", name);
scanf("%s", name);
scanf("%19s", &name);
Transcribed Image Text:Select the correct and safe ways to read a string with spaces from the user at the runtime and store it in character array of length 20 .(character (name fgets( name, 21, stdin); fgets("%19s",name,stdin); fgets(name, 19, stdin); scanf("%19s", name); scanf("%s", name); scanf("%19s", &name);
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT