Está en la página 1de 2

RECTÁNGULO DE ASTERISCOS

#include <iostream>
using namespace std;

int main(int arg,char** argv)


{
int i, j, la, an;
cout<<"introduce largo: "<<endl;
cin>>la;
cout<<"intoduce ancho: "<<endl;
cin>>an;

for (i=1; i<=la; i++)


{
for(j=0; j<an; j++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
}

PROGRAMA DE LA FUNCIONES

// tarea 2

#include<iostream>
#include<cmath>
#include<iomanip>

using namespace std;

int main()
{
double a,b,x1,y1,x2,y2,i;
cout<<"Ingrese los datos [a,b] "<<endl;
cin>>a>>b;
cout<<"Ingrese el incremento de la funcion ";
cin>>i;

cout<<setw(10)<<"x"<<setw(10)<<"y"<<endl;
x1=a;
x2=a;
while(x1<=0)
{
if(x1+5<=0 && 1/x2*x2-7*x2+12>0)
{
cout<<setw(10)<<x1<<setw(10)<<"NEP"<<endl;
cout<<setw(10)<<x2<<setw(10)<<"Nep"<<endl;
}
else
{
y1=sqrt(x1+5);
y2=1/(x2*x2-7*x2+12);
cout<<setw(10)<<x1<<setw(10)<<y1<<endl;
cout<<setw(10)<<x2<<setw(10)<<y2<<endl;

}
x1+=i;
x2+=i;
}

return 0;
}

senos y cosenos
// senos y cosenos

#include<iostream>}
#include<cmath>
#include<iomanip>
#define PI 3.1415926536

int main()
{
float x,seno,coseno,rad;
printf("ingresa un angulo en grados: ");
scanf("%f",&x);
rad=x*PI/180;
seno=sin(rad);
coseno=cos(rad);
printf("el seno = %.4f \n",seno);
printf("el coseno = %.4f \n",coseno);

return 0;
}

También podría gustarte