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

Explain the methods of implementing interacting processes, Explain any two ...

Explain any two methods of implementing interacting processes. Two methods of implementing interacting process are given below: (i) Shared memory solution: In this scheme

Calculations for a standard vga graphics screen, Q. Calculations for a stan...

Q. Calculations for a standard VGA graphics screen? Let's do the calculations for a standard VGA graphics screen (640×480) using 16 colours. Total number of Pixels = 640 ×48

Define the public and extrn directives- assembler directives, Define the PU...

Define the PUBLIC and EXTRN directives- Assembler directives PUBLIC and EXTRN directives are very significant to modular programming. PUBLIC used to declare that labels of data

Write a c++ program to explain three specific classes, Make a base class ca...

Make a base class called figure that store the dimensions of several geometrical objects and compute their areas. Explain a function set_dim( ),a standard member  function and show

What is a multiple line field, What is a multiple line field? A multipl...

What is a multiple line field? A multiple line field is a special part of field which allows the user to enter multiple lines of data into it.

Show the main drawback of cav disk, Q. Show the main drawback of CAV disk? ...

Q. Show the main drawback of CAV disk? The main drawback of CAV disk is that a lot of storage space is wasted because longer outer tracks are storing data only equal to the sho

Evaluate - 48 - 23 by using the 2's complement method, Perform the - 48 - 2...

Perform the - 48 - 23 operations using the 2's complement method. Ans. - 48 - 23 = - 48 + (-23)     -48     =  1 1 0 1 0 0 0 0     -23     =  1 1 1 0 1 0 0 1       = -71

Working of read-only memory, Q. Working of Read-Only Memory? A ROM is f...

Q. Working of Read-Only Memory? A ROM is fundamentally a memory or storage device in which a fixed set of binary information is stored. A block diagram of ROM is as displayed i

Message passing programming, Message passing is possible the most widely us...

Message passing is possible the most widely used parallel programming paradigm these days. It is the most portable, natural and efficient scheme for distributed memory systems. It

What are multi-cycle paths, What are multi-cycle paths? Multi-cycle pat...

What are multi-cycle paths? Multi-cycle paths are paths among registers which take more than one clock cycle to turn out to be stable. For illustration analyzing the de

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