MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / main

Function main

Examples/Modules/Chapter 08/Ex8_15.cpp:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6long& larger(long& a, long& b); // Reference parameters
7
8int main()
9{
10 double a_double {1.5}, b_double {2.5};
11 std::cout << std::format("The larger of double values {} and {} is {}\n",
12 a_double, b_double, larger(a_double, b_double));
13
14 int a_int {15}, b_int {25};
15 std::cout << std::format("The larger of int values {} and {} is {}\n",
16 a_int, b_int,
17 larger(static_cast<long>(a_int), static_cast<long>(b_int)));
18}
19
20// Returns the larger of two floating point values
21double larger(double a, double b)

Callers

nothing calls this directly

Calls 1

largerFunction · 0.70

Tested by

no test coverage detected