0% found this document useful (0 votes)
62 views

6a. Write A Program That Reads in Five Integers and Determines and Prints The Largest and The Smallest Integers in The Group

The document provides programming problems and exercises including: writing a program to compare two integers and print which is larger; a program to input three integers and calculate/print their sum, average, product, smallest, and largest values; programs to input integers and determine/print the largest/smallest or whether each integer is odd or even; programs to determine/print if one integer is a multiple of another or separate the digits of a five-digit integer and print them spaced apart; and writing a BMI calculator program that reads weight and height, calculates BMI, and displays the user's BMI along with interpretation guidelines.

Uploaded by

Treasure321
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

6a. Write A Program That Reads in Five Integers and Determines and Prints The Largest and The Smallest Integers in The Group

The document provides programming problems and exercises including: writing a program to compare two integers and print which is larger; a program to input three integers and calculate/print their sum, average, product, smallest, and largest values; programs to input integers and determine/print the largest/smallest or whether each integer is odd or even; programs to determine/print if one integer is a multiple of another or separate the digits of a five-digit integer and print them spaced apart; and writing a BMI calculator program that reads weight and height, calculates BMI, and displays the user's BMI along with interpretation guidelines.

Uploaded by

Treasure321
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

3.

Write a program that asks the user to enter two integers, obtains the
numbers from the user, then prints the larger number followed by the words "is
larger." If the numbers are equal, print the message "These numbers are equal."

4. Write a program that inputs three integers from the keyboard


and prints the sum, average, product, smallest and largest of these numbers. The
screen dialog should appear as follows:

6a. Write a program that reads in five integers and determines


and prints the largest and the smallest integers in the group.

6b. Write a program that reads an integer and determines and prints whether
it’s odd or even. [Hint: Use the modulus operator. An even number is a multiple of
two. Any multiple of two leaves a remainder of zero when divided by 2.]
7. Write a program that reads in two integers and determines and prints if the first
is a multiple of the second. [Hint: Use the modulus operator.]

8. Write a program that inputs a five-digit integer, separates the integer into its
digits and prints them separated by three spaces each. [Hint: Use the integer
division and modulus operators.] For example, if the user types in 42339, the
program should print:
10. (Body Mass Index Calculator)
The formulas for calculating BMI are

Create a BMI calculator application that reads the user’s weight in kilograms and
height in meters, then calculates and displays
the user’s body mass index. Also, the application should display the following
information from the Department of Health and Human Services/National
Institutes of Health so the user can evaluate
his/her BMI:

You might also like