Está en la página 1de 5

ECUACION

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
float x,y;
cout<<"Ingresar el valor de X:"<<endl;
cin>>x;
if (x>0)
{
y=((x*x-4)/2)+((3*x)-(7*x*x*x*x))/((-5*x*x*x)+(4*x-2));
cout<<"El valor de y es igual a:"<<y;
}
else
cout<<"el valor no es permitido";
getch();
}

------------------------------------------
INGRESAR 3 NOTAS DE UN ESTUDIANTE, PROMEDIARLAS Y DECIR CUAL ES LA MAYOR
Y CUAL EL MENOR

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
float a,b,c,P;
cout<<"INGRESE TRES CALIFICACIONES DEL ESTUDIANTE:"<<endl;
cin>>a>>b>>c;
if (a>=0 && b>=0 && c>=0 && a<=20 && b<=20 && c<=20)
{
P=(a+b+c)/3;
cout<<"EL PROMEDIO DE LAS CALIFICACIONES ES:"<<P;
}
else
cout<<"ERROR AL INGRESAR LAS CALIFICAIONES";
if (a>b && a>c)
cout<<"\nLA MAXIMA CALIFICAION ES:"<<a;
else if ( b>a && b>c)
cout<<"\nLA MAXIMA CALIFICACION ES:"<<b;
else if (c>a && c>b)
cout<<"\nLA MAXIMA CALIFICAION ES:"<<c;
if (a<b && a<c)
cout<<"\nLA MINIMA CALIFICAION ES:"<<a;
else if ( b<a && b<c)
cout<<"\nLA MINIMA CALIFICACION ES:"<<b;
else if (c<a && c<b)
cout<<"\nLA MINIMA CALIFICAION ES:"<<c;
else if (a==c && a==b && c==b)
cout<<"\nLAS CALIFICAIONES SON IGUALES";
getch();
}

-----------------------------------------------
INGRESAR LOS CATETOS DE UN TRIANGULO Y DETERMINAR SU HIPOTENUSA
SU AREA Y SU PERIMETRO

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
float a,b,h,S,P;
cout<<"INGRESE LOS CATETOS DEL TRIANGULO:"<<endl;
cin>>a>>b;
if (a>0 && b>0)
{
h=sqrt(a*a+b*b);
S=(a*b)/2;
P=a+b+h;
cout<<"EL VALOR DE LA HIPOTENUSA ES:::>"<<h;
cout<<"\nEL VALOR DEL AREA DEL TRIANGULOS ES:::>"<<S;
cout<<"\nEL VALOR DEL PERIMETRO ES:::>"<<P;
}
else
cout<<"ERROR AL INGRESAR LOS CATETOS";
getch();
}

----------------------------------------------
INGRESAR 5 NUMEROS E IDENTIFICAR EL MENOR o si son iguales, sin tomar
EN CUENTA LOS NUMEROS NEGATIVOS

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d,e;
cout<<"ingrese el primer numero:"<<endl;
cin>>a;
cout<<"ingrese el segundo numero:"<<endl;
cin>>b;
cout<<"ingrese el tercer numero:"<<endl;
cin>>c;
cout<<"ingrese el cuarto numero:"<<endl;
cin>>d;
cout<<"ingrese el quinto numero:"<<endl;
cin>>e;
if ((a>0)&&(b>0)&&(c>0)&&(d>0)&&(e>0))
{
if ((a<b)&&(a<c)&&(a<d)&&(a<e))
cout<<"el menor es:"<<a;
else if((b<a)&&(b<c)&&(b<d)&&(b<e))
cout<<"el menor es:"<<b;
else if((c<b)&&(c<a)&&(c<d)&&(c<e))
cout<<"el menor es:"<<c;
else if((d<b)&&(d<a)&&(d<c)&&(d<e))
cout<<"el menor es:"<<d;
else if((e<b)&&(e<a)&&(e<d)&&(e<c))
cout<<"el menor es:"<<e;
else
if((a==b)&&(a==c)&&(a==d)&&(a==e)&&(b==c)&&(b==d)&&(b==e)&&(c==d)&&(c==e)&&(d==e))
cout<<"los 5 numeros son iguales:";
}
else
cout<<"los numeros no son validos:";
getch();
}

------------------------------------------

INGRESAR LOS LADOS DE UN TRIANGULO Y DETERMINAR EL TIPO DE TRIANGULO

#include<iostream.h>
#include<conio.h>
void main()
{
float L1,L2,L3;
cout<<"ingrese el lado 1:"<<endl;
cin>>L1;
cout<<"ingrese el lado 2:"<<endl;
cin>>L2;
cout<<"ingrese el lado 3:"<<endl;
cin>>L3;
if ((L1!=L2)&&(L2!=L3)&&(L1!=L3))
cout<<"el triangulo es escaleno:";
else if ((L1==L2)&&(L2==L3)&&(L3==L1))
cout<<"el triangulo es equilatero:";
else
cout<<"el triangulo es isoceles:";

getch();
}

--------------------------------------------

DETERMINAR SI UN NUMERO ES MULTIPLO DE 3

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int x;
cout<<"ingrese el numero:"<<endl;
cin>>x;
if (x%3==0)
cout<<"el numero es multiplo de 3:";
else
cout<<"el numero no es multiplo de 3:";

getch();
}

-------------------------------------------

DETERMINAR LA POTENCIA DE UN NUMERO CUALQUIERA

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int x,y,z;
cout<<"ingrese el numero base:"<<endl;
cin>>x;
cout<<"ingrese el numero exponente:"<<endl;
cin>>y;

z=pow(x,y);
cout<<"resultado:"<<z;
getch();
}

--------------------------------------------

DIVIDIR 2 NUMEROS

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
float x,y,z;
cout<<"ingrese el numero:"<<endl;
cin>>x;
cout<<"ingrese el siguiente numero:"<<endl;
cin>>y;

if (y!=0)
{
z=x/y;
cout<<"la respuesta es:"<<z;
}
else
cout<<"la respuesta no existe";

getch();
}

---------------------------------------------

OPERACION DE 2 ECUACIONES

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
float y,x;
cout<<"ingrese el valor de x:"<<endl;
cin>>x;

if ((x>=-1) && (x<=5))


{
y=x*x*x+1;
cout<<"El valor de Y es:"<<y;
}
else if ((x>=-5)&&(x<-1))
{
y=(x*x*x*x+1)/2;
cout<<"El valor de Y es:"<<y;
}

if ((x>5)||(x<-5))
{
cout<<"no existe estos valores:";
}
getch();
}

-----------------------

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int x;
cout<<"Ingresar el numero:"<<endl;
cin>>x;
if(x%2==0)
cout<<"el numero es par";
else if (x==0)
cout<<"el numero es 0";
else
cout<<"el numero es impar";
getch();
}

También podría gustarte