top of page
PROGRAMACION EN C++ (CLASE 2)
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
cout<<"(01):CALCULO DE LA FUNCION F(X) \n";
cout<<"*********************************** \n";
double fx, RAD, PI=3.14;
int X;
cout<<"INGRESE EL VALOR DE X"; cin>>X;
RAD=(2*PI*X)/360;
fx=pow(sin(RAD),3)-2*pow(cos(RAD),2);
cout<<"EL RESULTADO ES="<<fx<<endl<<endl;
​
cout<<"(02):CALCULO DE LA TABLA DE VERDAD \n";
cout<<"*********************************** \n";
double R1, R2, R3, R4, V, F;
int A, B, C;
cout<<"INGRESE V:"; cin>>V;
cout<<"INGRESE F:"; cin>>F;
R1=V&&V;
R2=V&&F;
R3=F&&V;
R4=F&&F;
cout<<"LA TABLA DE VERDAD ES: \n";
cout<<"************************** \n";
cout<<V<<"AND"<<V<<"="<<R1<<endl;
cout<<V<<"AND"<<F<<"="<<R2<<endl;
cout<<F<<"AND"<<V<<"="<<R3<<endl;
cout<<F<<"AND"<<F<<"="<<R4<<endl;
cout<<endl;
​
cout<<"(03):CALCULO DE LA FUNCION TRIGONOMETRICA \n";
cout<<"********************************** \n";
double Fx, rad;
int Y;
cout<<"INGRESE EL VALOR DE Y"; cin>>Y;
rad=(2*PI*Y)/360;
Fx=pow(sin(rad),2)+pow(cos(rad),2);
cout<<"EL RESULTADO ES="<<Fx<<endl<<endl;
​
cout<<"(04):CALCULO DE LA FUNCION PARABOLICA \n";
cout<<"********************************************* \n";
double x, Rad, Fp;
cout<<"INGRESE EL VALOR DE x"; cin>>x;
Rad=(2*PI*x)/360;
Fp=pow(sin(Rad),2)+pow(cos(Rad),2);
cout<<"EL RESULTADO ES="<<Fp<<endl<<endl;
​
cout<<"(05):CALCULO DE LA PRESION \n";
cout<<"****************************** \n";
double P, F, a;
cout<<"INGRESE EL VALOR DE LA FUERZA"; cin>>F;
cout<<"INGRESE EL VALOR DEL AREA"; cin>>a;
P=F/a;
cout<<"LA PRESION ES="<<P<<endl<<endl;
​
cout<<"(06):CALCULO DE LA FUNCION LOGICA \n";
cout<<"*************************************** \n";
double R5;
int A, B;
cout<<"INGRESE A"; cin>>A;
cout<<"INGRESE B"; cin>>B;
R5=(A>B)&&(B==A)||(A!=B);
cout<<"LA RESPUESTA ES="<<R5<<endl<<endl;
​
system("pause")
return 0;
}
​
​
bottom of page