You are on page 1of 6

/*

************************************
**
**
**
PROGRAMA PARA VER QUE
**
**
NUMERO ES MAYOR O
**
**
SI SON IGUALES
**
**
**
************************************
*/
#include<iostream>
using namespace std;
void main(void)
{
int N1, N2;
cout << "Ingrese el 1er numero: ";
cin >> N1;
cout << "Ingrese el 2do numero: ";
cin >> N2;
if (N1 > N2)
{
printf("\nEl numero %d es mayor que el numero %d\n\n\n", N1, N2);
}
else if (N2 > N1)
{
printf("\nEl numero %d es mayor que el numero %d\n\n\n", N2, N1);
}
else
{
printf("\nLos numeros son iguales y su valor es %d\n\n\n", N1);
}
system("pause");
}

/*
************************************
**
**
**
PROGRAMA PARA SABER SI
**
**
APRUEBA DESAPRUEVA
**
**
O SUBSA
**
**
**
************************************
*/

#include<iostream>
using namespace std;
void main(void)
{
float N1, N2, N3, P;
cout << "Ingrese la 1ra nota: ";
cin >> N1;
cout << "Ingrese la 2da nota: ";
cin >> N2;
cout << "Ingrese la 3ra nota: ";
cin >> N3;
P = (N1 + N2 + N3) / 3;
if (P < 8)
{
printf("\nUd. esta desaprobado con %.2f\n\n\n", P);
}
else
{
if (P >= 10.5)
{
printf("\nUd. esta aprobado con %.2f\n\n\n", P);
}
else
{
printf("\nUd. puede rendir subsanacion ya que su promedio es %.2f\n\n\n", P);
}
}
system("pause");
}

/*

************************************
**
**
**
PROGRAMA PARA SABER SI
**
**
APRUEBA DESAPRUEVA
**
**
O SUSTI (CON NUEVO
**
**
PROMEDIO FINAL)
**
**
**
************************************
*/

#include<iostream>
using namespace std;
void main(void)
{
float P1, EP, P2, EF,
cout << "Ingrese nota
cin >> P1;
cout << "Ingrese nota
cin >> EP;
cout << "Ingrese nota
cin >> P2;
cout << "Ingrese nota
cin >> EF;

P, NS, PF, PP;


de la Primera Practica: ";
del Examen Parcial: ";
de la Segunda Practica: ";
del Examen Final: ";

PP = (P1 + P2) / 2;
P = (PP + EP + EF) / 3;
if (P < 8)
{
printf("\nUd. esta desaprobado con %.2f\n\n\n", P);
}
else
{
if (P >= 10.5)
{
printf("\nUd. esta aprobado con %.2f\n\n\n", P);
}
else
{
printf("\nUd. puede rendir Sustitutorio ya que su promedio es %.2f\n\n", P);
cout << "Ingrese su Nota de Sustitutorio: ";
cin >> NS;
if (EP < EF)
{
PF = (PP + NS + EF) / 3;

}
else
{
PF = (PP + EP + EF) / 3;
}
if (PF >= 10.5)
{
printf("\nUd. esta aprobado con %.2f\n\n\n", PF);
}
else
{
printf("\nUd. esta desaprobado con %.2f\n\n\n", PF);
}
}
}
system("pause");
}

/*

************************************
**
**
**
PROGRAMA DE 3 OPCIONES
**
**
USANDO if
**
**
**
************************************
*/

#include<iostream>
using namespace std;
void main(void)
{
int N;
cout << "ingrese un numero: ";
cin >> N;
if (N == 1)
{
printf("\nOpcion 1\n\n\n");
}
else
{
if (N == 2)
{
printf("\nOpcion 2\n\n\n");
}
else
{
if (N == 3)
{
printf("\nOpcion 3\n\n\n");
}
else
{
printf("\nOpcion No Valida\n\n\n");
}
}
}
system("pause");
}

/*

************************************
**
**
**
PROGRAMA DE 3 OPCIONES
**
**
USANDO switch
**
**
**
************************************
*/

#include<iostream>
using namespace std;
void main(void)
{
int opc;
cout << "ingrese un numero: ";
cin >> opc;
switch (opc)
{
case 1:
printf("\n\nOpcion 1\n\n\n");
break;
case 2:
printf("\n\nOpcion 2\n\n\n");
break;
case 3:
printf("\n\nOpcion 3\n\n\n");
break;
default:
printf("\n\nOpcion No valida\n\n\n");
break;
}

system("pause");
}

You might also like