martes, 3 de mayo de 2011

jueves, 28 de abril de 2011

sábado, 19 de marzo de 2011

sábado, 5 de marzo de 2011

funcion 4

funcion 4

#include
#include
#include

int maximo(int n1, int n2)
{
if(n1>n2)
return n1;
else
return n2;
};

void main()
{
int n1, n2;
int max;
cout << "Ingrese n1: ";
cin >> n1;
cout << "Ingrese n2: ";
cin >> n2;
max=maximo(n1,n2);
cout<<"El numero mayor es:"<< max;
}

funcion 3

funcion 3

#include
#include
#include

int maximo()
{
int n1, n2;
int max;
cout << "Ingrese n1: ";
cin>>n1;
cout << "Ingrese n2: ";
cin>>n2;
max=(n1,n2);
if(n1>n2)
max=n1;
else
max=n2;
return max;
};

int main()
{
int max;
max=maximo();
cout<<"El numero mayor es:"<< max;
}