A

Admin • 833K Points
Coach

Q. We want to get a decimal number entered from the keyboard, which statement is correct?

  • (A) scanf("%f",decimalNumber);
  • (B) scanf("%f",&decimalNumber);
  • (C) scanf("%lf", *decimalNumber);
  • (D) scanf("%d",decimalNumber);
  • Correct Answer - Option(B)
  • Views: 28
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

scanf is a function declared in the <stdio.h> header, this function can be used for capturing formatted data, whether letters, numbers or strings.

%d to print integer and %f to print float value.



You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.