Está en la página 1de 2

/*

************************************
**
**
**
PROGRAMA PARA CALCULAR
**
**
EL AREA DE UN
**
**
TRIANGULO
**
**
**
************************************
*/

#include<iostream>
#include<math.h>
using namespace std;
void main(void)
{
int b,h,A;
cout << "Ingrese la base:\t";
cin >> b;
cout << "Ingrese la altura:\t";
cin >> h;
A = (b*h) / 2;
cout << "\nEl area es " << A << "\n\n";
system("pause");
}

/*
************************************
**
**
**
PROGRAMA PARA CALCULAR
**
**
EL PROMEDIO DE
**
**
3 NOTAS
**
**
**
************************************
*/

#include<iostream>
#include<math.h>
using namespace std;
void main(void)
{
int n1,n2,n3,p;
cout << "Ingrese nota 1:\t";
cin >> n1;
cout << "Ingrese nota 2:\t";
cin >> n2;
cout << "Ingrese nota 3:\t";
cin >> n3;
p = (n1+n2+n3) / 3;
cout << "\nEl promedio es " << p << "\n\n";
system("pause");
}

También podría gustarte