Documentos de Académico
Documentos de Profesional
Documentos de Cultura
int main()
{
double x;
system("color 1f");
if (x > 4)
{
x = pow(x, 3) + 4 * pow(x, 2) - 3 * x + 5;
else
{
cout << "el resultado es " << x << " \n\n\t\t ";
system("pause");
return 0;
}
Ejercicio que lea un numero, si esta entre 20 y 30,duplicarlo de lo contrario
dividirlo por 4
#include <iostream>
using namespace std;
int main()
{
double numero;
system("color 1f");
cout << " \t\t\t PROGRAMA PARA DETERMINAR SI EL NUMERO ESTA ENTRE 20 Y 30 \n
";
{
numero *= 2;
else
{
numero /= 4;
}
system("pause");
return 0;
}
Ejercicio del taller 8, si el numero es palíndromo
#include <iostream>
using namespace std;
int main()
{
short int num_1, num_2, num_3;
system("color 1f");
if (num_1 == num_3)
{
cout << "El numero es palindromo";
}
else
{
cout << "El numero no es paliondromo";
}
system("pause");
return 0;
}
EJECICIO DE SI EL NUMERO ES POSITIVO MULTIPLICARLO POR 5 , SI EL NUMERO ES NEGATIVO
DIVIDIRLO POR 5, DE LO CONTRARIO, SUMAR 5
#include <iostream>
using namespace std;
int main()
{
double numero;
system("color 1f");
cout << " \t\t\t PROGRAMA PARA DETERMINAR SI EL NUMERO 5 es positivo o
negativo \n\n ";
if (numero > 0)
{
numero *= 5;
else
{
if (numero < 0)
{
numero /= 5;
}
else
numero += 5;
}
system("pause");
return 0;
}
EJERCICIO PUNTO 2 DEL TALLER 8
#include <iostream>
using namespace std;
int main()
{
double x;
system("color 1f");
cout << " \t\t\t PROGRAMA PARA DETERMINAR A FUNCION n\n ";
if (x <=4)
{
x = 3 * pow(x, 3) - 2 * pow(x, 2) + 5;
else
{
x = 2 * pow(x, 2) - 2;
system("pause");
return 0;
}
Ejercicio del menú del negocio de comidas rapidas
#include <iostream>
using namespace std;
int main()
{
int pedido;
system("color 1f");
cout << " \t\t\t PROGRAMA PARA ESCOGER EL MENU DE UN NEGOCIO DE COMIDAS
RAPIDAS n\n ";
case 1:
cout << "El precio del menu 1 es $6.500";
break;
case 2:
cout << "El precio del menu 2 es $2.500";
break;
case 3:
cout << "El precio del menu 3 es $3.500";
break;
case 4:
cout << "El precio del menu 1 es $2.500";
break;
default:
cout << "vayase a otro negocio jajaja";
system("pause");
return 0;
}