LearnFrenzy
Sign in Take a free test

C Input / Output · Input/Output MCQ · Question 10

What does * mean in scanf("%*d %d", &x)? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 10 Back to Exercise

In scanf("%*d %d", &x);, what does the * do?

  • A Takes the field width from an argument, as in printf
  • B Reads an integer and discards it, so x gets the second integer Correct
  • C Reads into a pointer
  • D Makes the conversion optional
Correct Answer: Option B

In scanf, * suppresses assignment and the item is not counted in the return value. scanf has no way to take a width from an argument.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links