Question1 Write a procedure to find the maximum of three numbers. Procedure specification: • Prototype: int max3(int a, int b, int c). - Parameter(s): a, b, c = Z. - Return value: the largest number among a, b and c. • e.g, max3(10, 20, 30) = 30, max3(1, 1, 1) = 1, max2(10, -20, -30) = 10 Main procedure specification: • • • Read three integers, a, b and c, using input macro. Call max3 procedure to find the largest. Display the result returned from your procedure using output macro.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27PE
icon
Related questions
Question
Question1 Write a procedure to find the maximum of three numbers.
Procedure specification:
•
Prototype: int max3(int a, int b, int c).
- Parameter(s): a, b, c = Z.
- Return value: the largest number among a, b and c.
•
e.g, max3(10, 20, 30) = 30, max3(1, 1, 1) = 1, max2(10, -20, -30) = 10
Main procedure specification:
•
•
•
Read three integers, a, b and c, using input macro.
Call max3 procedure to find the largest.
Display the result returned from your procedure using output macro.
Transcribed Image Text:Question1 Write a procedure to find the maximum of three numbers. Procedure specification: • Prototype: int max3(int a, int b, int c). - Parameter(s): a, b, c = Z. - Return value: the largest number among a, b and c. • e.g, max3(10, 20, 30) = 30, max3(1, 1, 1) = 1, max2(10, -20, -30) = 10 Main procedure specification: • • • Read three integers, a, b and c, using input macro. Call max3 procedure to find the largest. Display the result returned from your procedure using output macro.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning