You are on page 1of 3

TEOREMA DE HERON.

#include <cstdlib>

#include <iostream>

#include <cmath>

using namespace std;

float a,b,c, p,d;

int main(int argc, char *argv[])

cout<<"Teorema de Heron - iberth"<<endl;

cout<<"inserta un numero: ";

cin>>a;

cout<<"inserta un numero: ";

cin>>b;

cout<<"inserta un numero: ";

cin>>c;

p=(a+b+c)/(2);

d=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<"El area de un triangulo es: "<<d<<endl;

system("PAUSE");

return EXIT_SUCCESS;

}
INTEGRAL

#include <cstdlib>

#include <iostream>

#include <math.h>

#include <conio.h>

using namespace std;

int main(int argc, char *argv[])

float a, b, c, d, integral;

cout<<"Integral definida en a y b:\n"<<endl;

cout<<"\n\nIngrese el valor de a: ";

cin>>a;

cout<<"Ingrese el valo de b: ";

cin>>b;

cout<<"Ingrese el valo de c: ";

cin>>c;
cout<<"Ingrese el valo de d: ";

cin>>d;

integral=((c*pow(b,3))/3+d*b)-((c*pow(a,3))/3+d*a);

cout<<"La integral es: "<<integral<<endl;

getch ();

You might also like