index | submit | rank | book

mult – Multiplication

Write a program that calculates the product of three numbers. Your program should read from the standard input and print to the standard output. The standard input and output devices are usually the keyboard and screen of a command line session. Here is an example session:

$ ./mult1
3 7 1
234 321 999

Input and output

Input consists of several lines each with three natural numbers x, y and z where -1000 ≤ x, y, z ≤ 1000.

The output should contain a single line with an integer w where w = x × y × z.

The numbers x, y and z may be given in the input with leading zeroes. The number w should appear on the output without leading zeroes. Input is terminated by the end of file.

Example input

2 3 4
3 7 1
234 321 -999

Example output


The mult function

For a full score, in addition to producing the correct output, the program should be implemented using a mult function that takes three integers as arguments and returns an integer. Please refer to the information for the chosen language:

If you’re confused, try earning a partial score first by just implementing I/O processing.


Submit your solution to be graded according to the following list:


  1. Produce output as you go. As soon as you read a line of input you can produce a line of output.

  2. Input is terminated at EOF. You can simulate it on the terminal using the “Control-D” keystroke.

  3. If you have difficulty, look at easier exercises or read the Computer Science by Example book.

try first: add mult1

try next: pi box

index | submit | rank | book

Copyright © 2020-2021 Rudy Matela
All rights reserved