Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Unlike integer numbers, the field width of real numbers is not to be specified and therefore scanf reads real numbers using the simple specification %f
Unlike integer numbers, the field width of real numbers is not to be specified and therefore scanf reads real numbers using the simple specification %f for both the notations, namely, decimal point notation and exponential notation. For example, the statement scanf("%f %f %f", &x, &y, &z): with the input data 475.89 43.21E-1 678 will assign the value 475.89 to x, 4.321 to y, and 678.0 to z. The input field specifications may be separated by any arbitrary blank spaces. If the number to be read is of double type, then the specification should be % If instead of simple %f. A number may be skipped using %*f specification. Reading of real numbers (in both decimal point and exponential notation) is illustrated in Fig. 1.80
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started