1). DISEÑAR UN PROGRAMA QUE ME PERMITA INGRESAR DOS NÚMEROS Y QUE MUESTRE EN PANTALLA CUAL ES EL MAYOR;
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
void main ()
{
float n1, n2;
gotoxy (1,2);cout <<"****************************************";
gotoxy (1,3);cout <<"*"; gotoxy (10,3);cout <<"MAYOR DE DOS NUMEROS";
gotoxy (1,4);cout <<"*";gotoxy (1,5);cout <<"*";gotoxy (1,6);cout <<"*";
gotoxy (1,7);cout <<"*";gotoxy (1,8);cout <<"*";gotoxy (1,9);cout <<"*";
gotoxy (1,10);cout <<"*";gotoxy (1,11);cout <<"*";
gotoxy (1,11);cout <<"****************************************";
gotoxy (40,3);cout <<"*";gotoxy (40,4);cout <<"*";gotoxy (40,5);cout <<"*";
gotoxy (40,6);cout <<"*";gotoxy (40,7);cout <<"*";gotoxy (40,8);cout <<"*";
gotoxy (40,9);cout <<"*";gotoxy (40,10);cout <<"*";gotoxy (40,11);cout <<"*";
gotoxy (30,9);cout <<"|";gotoxy (37,9);cout <<" |";
gotoxy (30,8);cout <<" _______";gotoxy (22,10);cout <<"----------------";
gotoxy (16,9);cout<< " EL MAYOR ES: ";gotoxy (28,12);cout<< "Lenin Zapata.";
gotoxy (5,5);cout <<"ingrese un numero: "; cin>> n1;
gotoxy (5,6);cout <<"ingrese el otro numero: "; cin>> n2;
if(n1>n2)
{
gotoxy (34,9);cout << n1;
}
else
{
gotoxy (34,9);cout << n2;
}
getch ();
}
2). DISEÑAR UN PROGRAMA QUE ME PERMITA INGRESAR TRES NÚMEROS Y QUE MUESTRE EN PANTALLA CUAL ES EL MAYOR Y MENOR DE ELLOS;
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
void main ()
{
float n, nn, n1, n2, n3;
gotoxy (2,2);cout <<"***************************************";
gotoxy (2,3);cout <<"*"; gotoxy (10,3);cout <<"MAYOR DE TRES NUMEROS";
gotoxy (2,4);cout <<"*";gotoxy (2,5);cout <<"*";gotoxy (2,6);cout <<"*";
gotoxy (2,7);cout <<"*";gotoxy (2,8);cout <<"*";gotoxy (2,9);cout <<"*";
gotoxy (2,10);cout <<"*";gotoxy (2,11);cout <<"*";gotoxy (2,12);cout <<"*";
gotoxy (2,13);cout <<"*";gotoxy (2,14);cout <<"*";
gotoxy (2,15);cout <<"***************************************";
gotoxy (40,3);cout <<"*";gotoxy (40,4);cout <<"*";gotoxy (40,5);cout <<"*";
gotoxy (40,6);cout <<"*";gotoxy (40,7);cout <<"*";gotoxy (40,8);cout <<"*";
gotoxy (40,9);cout <<"*";gotoxy (40,10);cout <<"*";gotoxy (40,11);cout <<"*";
gotoxy (40,12);cout <<"*";gotoxy (40,13);cout <<"*";gotoxy (40,14);cout <<"*";
gotoxy (30,11);cout <<"|";gotoxy (30,13);cout <<"|";
gotoxy (37,11);cout <<" |";gotoxy (37,13);cout <<" |";
gotoxy (30,10);cout <<" _______";gotoxy (17,12);cout <<"----------------------";
gotoxy (17,14);cout <<"----------------------";
gotoxy (16,11);cout<< " EL MAYOR ES: ";gotoxy (16,13);cout<< " EL MENOR ES: ";
gotoxy (28,16);cout<< "Lenin Zapata.";
gotoxy (5,5);cout <<"ingrese el primer numero: => "; cin>> n1;
gotoxy (5,6);cout <<"ingrese el segundo numero: => "; cin>> n2;
gotoxy (5,7);cout <<"ingrese el tercer numero: => "; cin>> n3;
if(n1>n2)
{
n= n1;
nn=n2;
}
else
{
n =n2;
nn=n1;
}
if (n>n3)
{ gotoxy (34,11);cout<< n;}
else
{gotoxy (34,11);cout<< n3;}
if (nn<n3)
{ gotoxy (34,13);cout<< nn; }
else
{ gotoxy (34,13);cout<< n3; }
getch ();
}
GRACIAS POR SU VISITA.