Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Area and Perimeter of a Rectangle

    float length,width;

    cout<<"Enter the length: ";
    cin>>length;
    cout<<"Enter the width: ";
    cin>>width;

    cout<<"The Perimeter of the Rectangle is "<<(2*length)+(2*width)<<endl;
    cout<<"The Area of the Rectangle is "<<length*width<<endl;
 
PREVIOUS NEXT
Tagged: #Area #Perimeter #Rectangle
ADD COMMENT
Topic
Name
9+3 =