Skip to content

Instantly share code, notes, and snippets.

@uysalserkan
Created January 20, 2019 13:34
Show Gist options
  • Save uysalserkan/d0bceabd841986a578764fdbbc200258 to your computer and use it in GitHub Desktop.
Save uysalserkan/d0bceabd841986a578764fdbbc200258 to your computer and use it in GitHub Desktop.
The program find the are of the equilateral triangle.
#include <iostream>
#include <math.h>
using namespace std;
double area(double);
int main(){
double x1;
cout <<"Please enter one side dimesion: ";
cin>>x1;
cout <<"Your area is: "<<area(x1)<<endl;
system("pause");
}
double area(double dimesion){
double area;
area = dimesion*dimesion*sqrt(3)/4;
return area;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment