Skip to content

Instantly share code, notes, and snippets.

@hsandid
Created February 12, 2018 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsandid/586f232167da980d06b74fdeb2fe15ac to your computer and use it in GitHub Desktop.
Save hsandid/586f232167da980d06b74fdeb2fe15ac to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
cout<<"Enter the length and width of a rectangle\n";
double length,width,perimeter,area;
cin>>length>>width;
perimeter=(2*length)+(2*width);
area=length*width;
cout<<"The rectangle perimeter is: "<<perimeter<<endl;
cout<<"The rectangle area is: "<<area;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment