Está en la página 1de 3

PUBLICADO POR "MILTON YAUCAN"

COMO LE VA LICEN ESPERO QUE MUY BIEN BUENO ESTE SON LOS PROGRAMAS QUE PUBLICO
DISCULPARA POR NO HACER EN VIDEOS ES QUE LO QUE PASA SE ME PERDIO EL CD DE CANT
ANCIA
POR ESO NO PUEDO HACER EN VIDEOS BUENO QUE LE VAYA BIEN EN SU VIDA DIARIA
ESTE ES LA PRIMERA FUNCION NO RECIBEN NI RETORNAN
#include<iostream.h>
void mayor()
{
int n1, n2;
cout << "NUMERO 1: "; cin >> n1;
cout << "NUMERO 2:a "; cin >> n2;
if (n1>n2)
{
cout<<endl<<" NUMERO MAYOR ES: "<<n1<<endl;
cout<<" NUMERO MENOR ES: "<<n2;
}
else
{
cout<<endl<<" NUMERO MAYOR ES: "<<n2<<endl;
cout<<" NUMERO MENOR ES: "<<n1;
}
}
int main()
{
mayor();
}
ES EL SEGUNDO PROGRAMA
#include<iostream.h>
void mayor(int n1, int n2)
{
if (n1>n2)
{
cout<<endl<<" NUMERO MAYOR ES: "<<n1<<endl;
cout<<"NUMERO MENOR ES: "<<n2;
}
else
{
cout<<endl<<" NUMERO MAYOR : "<<n2<<endl;
cout<<"NUMERO MENOR : "<<n1;
}
}
int main()
{
int n1, n2;
cout << "NUMERO 1: "; cin >> n1;
cout << "NUMERO 2: "; cin >> n2;
mayor(n1, n2);
}
ES EL TERCERO RETORNAN Y NO RECIBEN......
#include<iostream.h>

int mayor()
{
int n1, n2,r;
cout << "Numero 1: "; cin >> n1;
cout << "Numero 2: "; cin >> n2;
if (n1>n2)
{
r=n1;
}
else
{
r=n2;
}
return r;
}
int main()
{
int r;
r=mayor();
cout<<endl<<" NUMERO MAYOR ES: "<<r;
}
ESTE ES EL ULTIMO PROGRAMA
#include<iostream.h>
int mayor(int n1, int n2)
{
int r;
if (n1>n2)
{
r=n1;
}
else
{
r=n2;
}
return r;
}
int menor(int n1, int n2)
{
int m;
if (n1<n2)
{
m=n1;
}
else
{
m=n2;
}
return m;
}
int main()
{
int n1, n2, r,m;
cout << "NUMERO 1: "; cin >> n1;
cout << "NUMERO 2: "; cin >> n2;
r = mayor(n1, n2);
m=menor(n1,n2);
cout <<endl<< " NUMERO MAYOR ES: " << r<<endl;
cout << "NUMERO MENOR ES: " << m;
}
getch();

También podría gustarte