Advertisement
heimsventus

Dailies 2 Ben Thompson #1 Triangle

Jan 22nd, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7.  
  8.     int base = 15;
  9.     float height = 8.82;
  10.     float area2 = (.5*base*height);
  11.     int s1 = 15;
  12.     int s2 = 17;
  13.     int s3 = 15;
  14.     int perimeter2 = s1 + s2 + s3;
  15.     cout << " This program calculates triangle area and perimeter." << endl;
  16.     cout << "The triangle's perimeter is " << perimeter2 << "and the area is " << area2 << "." << endl;
  17.  
  18.     system("pause");
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement