Skip to content

Instantly share code, notes, and snippets.

@ninpl
Created March 16, 2017 17:11
Show Gist options
  • Save ninpl/ad96879d900b1a86f92f2b12ca322d8f to your computer and use it in GitHub Desktop.
Save ninpl/ad96879d900b1a86f92f2b12ca322d8f to your computer and use it in GitHub Desktop.
Hallar el area de un triangulo
// Practica para refrescar la sintaxis de C++
#include <iostream>
using namespace std;
int main()
{
// Hallar el area de un triangulo
float base,altura,area;
cout<<"Ingrese la base del triangulo:";
cin>>base;
cout<<"Ingrese la altura:";
cin>>altura;
area = (base*altura)/2;
cout<<"El area es "<<area<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment