Skip to content

Instantly share code, notes, and snippets.

@GregoryHlavac
Created July 10, 2018 02:15
Show Gist options
  • Save GregoryHlavac/d07860e7d3204960b7a7cfe2bbdb65cc to your computer and use it in GitHub Desktop.
Save GregoryHlavac/d07860e7d3204960b7a7cfe2bbdb65cc to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int length, width, area;
void welcomeMessage()
{
cout << "This program was designed to calculate the area of a triangle.\n" << endl;
}
int rect_fun()
{
area = length * width;
cout << "The area of the triangle is " << area << "." << endl;
}
int main(const char*)
{
welcomeMessage();
cout << "Please enter the length of the triangle.\n";
cin >> length;
cout << "Please enter the width of the triangle.\n";
cin >> width;
rect_fun();
cout << "Have a nice day!!" << endl << endl;
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment