Answer:
- #include <iostream>
- using namespace std;
- void printLarger(int a, int b){
-
- if(a > b){
- cout<<a;
- }else{
- cout<<b;
- }
- }
- int main()
- {
- printLarger(4, 5);
- return 0;
- }
Step-by-step explanation:
The solution code is written in C++.
Firstly define a function printLarger that has two parameters, a and b with both of them are integer type (Line 5). In the function, create an if condition to check if a bigger than b, print a to terminal (Line 7-8). Otherwise print b (Line 9-10).
In the main program, test the function by passing 4 and 5 as arguments (Line 16) and we shall get 5 printed.