-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9.2.-OUTPUT DE FUNCIONES..cpp
57 lines (54 loc) · 1.09 KB
/
9.2.-OUTPUT DE FUNCIONES..cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include <string>
//INPUT Y OUTPUT DE FUNCIONES
void max_str(const std::string& input1, const std::string input2,std::string& output)
{
if (input1 > input2)
{
output = input1;
}
else
{
output = input2;
}
}
void max_int(const int input1, const int input2, int& output)
{
if (input1 > input2)
{
output = input1;
}
else
{
output = input2;
}
}
void max_double(const double input1, const double input2, double& output)
{
if (input1 > input2)
{
output = input1;
}
else
{
output = input2;
}
}
int main()
{
std::string str1 = "holaaaaa";
std::string str2 = "adios";
std::string output;
max_str(str1, str2, output);
std::cout << "max_str : " << output <<std::endl;
int outin;
int in1{90};
int in2{330};
max_int (in1,in2,outin);
std::cout << "max_int : " << outin << std::endl;
double indbl1{13.09};
double indbl2{231.23};
double outdbl;
max_double(indbl1, indbl2, outdbl);
std::cout << "max_double : " << outdbl << std::endl;
}