Fantasy F.

asked • 01/27/21

Write a program to convert kilogram to gram and pound

Declare an array as a global variable, called kilo with 4 elements.

- In main():

Call function get_input().

Call function convert_gram().

Call function convert_pound().


- In get_input():

Using for loop, prompt the user to input the values in kilogram and store them inthe array kilo.


- In convert_gram():

Use for loop to convert the values in grams and display the values.

Formula: 1 kg = 1000 g


- In convert_pound():

Use for loop to convert the values in pounds and display the values.

Formula: 1 kg = 2.205 pounds


Sample Output

Enter the value in Kilogram

3.5

6.75

0.45

2.1


Convert Kilo to Gram

3.50 is equal to 3500.00 grams

6.75 is equal to 6750.00 grams

0.45 is equal to 450.00 grams

2.10 is equal to 2100.00 grams


Covert Kilo to Pound

3.50 is equal to 7.72 pound

6.75 is equal to 14.88 pound

0.45 is equal to 0.99 pound

2.10 is equal to 4.63 pound

Patrick B.

source code uploaded to RESOURCES section under this link
Report

01/27/21

1 Expert Answer

By:

Patrick B. answered • 01/27/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.