Scanf function, Computer Engineering

Assignment Help:

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

 


Related Discussions:- Scanf function

Problems for decision tree learning, A ppropriate Problems for Decision Tr...

A ppropriate Problems for Decision Tree Learning - Artificial intelligence It is a expert job in AI to select accurately the right learning representation for a particular lea

Stata about the magnetic stripes, Stata about the Magnetic stripes  Th...

Stata about the Magnetic stripes  These comprise information/data stored on magnetic material often on the back of a credit/debit card; the information is automatically read b

Programming in c, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

How to define a filename in dos, Q. How to define a Filename in DOS? Ea...

Q. How to define a Filename in DOS? Each file is given a name so that it can be referred to later. This name is termed as Filename. The filename in DOS can be up to eight alpha

Predicates in propositional model, Predicates in propositional model: ...

Predicates in propositional model: The predicates take a number of arguments in which for now we assume are ground terms and represent a relationship between those arguments t

Fact Finding, What and why use fact finding.

What and why use fact finding.

Major task of a computer to carry out instruction execution, The major task...

The major task of a computer is to carry out instruction execution. The key questions that can be asked in this respect are: (a) how are the instructions provided to computer? And

Classification according to part of instruction and data, Classification ac...

Classification according to part of instruction and data: According to the parts of instruction and data, following parts are identified under this classification: Scal

Find the responses when a computer broadcast an arp reqqest, How many respo...

How many responses does a computer expect to receive when it broadcast an ARP request? Why? An ARP (Address Resolution Protocol) request message is put in a hardware frame and

Cisc approach - cisc architecture, CISC Approach - CISC architecture: ...

CISC Approach - CISC architecture: The main goal of CISC architecture is to finish a task in as few lines of assembly as possible as. This is gain by building processor hardwa

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd