how can the maximum field width for a data item


How can the maximum field width for a data item be specified within a scanf function?

When the program is executed, three integer quantities will be entered from the standard input device. Suppose the input data items are entered as

1    2    3

Then the following assignments will result:

a=1, b=2, c=3

If the data had been entered as

 

123  456   789

Then the assignments would be as a=123, b=456, c=789

Now suppose that the data had been entered as

123456789

Then the assignments would be

A=123, b=456, c=789

As before, since the first three digits would be assigned to a, the next three digits to b, and the last three digits to c.

If the data had been entered as

1234   5678  9

the resulting assignment would now be a=123, b=4,c=567

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: how can the maximum field width for a data item
Reference No:- TGS0305467

Expected delivery within 24 Hours