answersLogoWhite

0


Best Answer

#include <stdio.h>

int main (void) {

unsigned f1, i1, f2, i2;

scanf ("Enter the 1st length in feet and inches: %u%u", f1, i1);

scanf ("Enter the 2nd length in feet and inches: %u%u", f2, i2);

unsigned inches = i1 + i2 + (12 * (f1 + f2)); // sum the inches (convert feet to inches)

unsigned feet = inches / 12; // convert inches to feet

inches %= 12; // determine the remaining inches

printf ("The total length is %u feet %u inches.\n", feet, inches);

return 0;

}

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do I write a program that inputs the length of two pieces of fabric in feet and inches as whole numbers and prints the total?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How many inputs does a decision box in a program flow chart?

One or more (and it has two or more outputs).


What are the inputs of TQM?

inputs of TQM


Introduction multiplexer demultiplexer?

A multiplexer, commonly referred as an input selector, is a circuit with many inputs but only one output: it has some data inputs, control inputs and one output, depending on the control inputs, one input from the data inputs is sent to the output .A demultiplexer is a circuit with one data input, few control inputs and many outputs, it is also known as output selector.


What is the input output subsystem?

It is the specific layer of the operating system responsible for translating hardware and software inputs, such as keyboard and mouse event data, into data the application can use, and translating application output into hardware and software outputs, such as the screen or a printer. This layer of abstraction allows the program and various inputs and outputs to be decoupled.For example, in a terminal program, output is normally sent to the screen, but can be redirected to a file, printer, a network socket, or even another program, without the program needing any special consideration as to how to write this data to various outputs. Also, most terminal programs expect input from the keyboard, but this input can similarly be fed from any valid source (e.g. any source that has an output to connect to an input).


What does logic mean in computing?

it's a little and basic integrated circuit that makes calculations regarding Boole's logic (true/false) they can make various operations instantly regarding as the type of logic gate based on the 2 inputs, giving the result as output. they can make the OR operand, And, Xor,Not and a combination of them (cheaper) Nor,Nand,XNor it's the base for digital computing.

Related questions

How do I write a program that inputs the length of two pieces of fabric in feet and inches (as whole numbers) and prints the total. Enter the Feet for the first piece of fabric 3 Enter the Inches for?

An example: Feet for first piece of fabric: 2 Inches for first piece of fabric: 7 Feet for 2nd piece of fabric: 2, Inches for 2nd piece of fabric: 6 I need the program to print: Feet: 5 Inches: 1


What inputs letters numbers and special command?

Saviorit


How do you make program specification?

you first of all state the function of the program. State the inputs that will be used,the algorithm and the outputs of the program.


What is the input of the fashion industry?

the inputs are things like buttons, bead, fabric - all the things that make up a output such as a dress or coat. Inputs aren't worth as much compared to the output which is where the profit is usually made.


What is a set of numbers containing all of the inputs of a function called?

the domain of the function


What device inputs letters numbers and special commands?

The computer keyboard.


What are the maximum numbers of inputs and outputs that a flip-flop can have?

A: The inputs can be many but the outputs can only be two true or false. In try state flip flop the outputs can be open that will make 3


What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?


How many inputs does a decision box in a program flow chart?

One or more (and it has two or more outputs).


Does the mount impede access to any cable inputs on the LCS screen?

No, the Vantage Point LCD Wall Mount would not impede access to cable inputs, it gives you 18.5 inches of access between the monitor and wall.


What is a keyboard and what is it used for?

A keybord is a number of keys with numbers and alphabets, useful for giving inputs to CPU for processing purpose.


How do calculators know answers?

They take your inputs (numbers and operations) and use digital logic circuits to combine them into the requested answer.