LESSUN SA LAB 91 Introduction to Pointer Variables Retrieve
LESSUN SA LAB 9.1 Introduction to Pointer Variables Retrieve program poin from the Lab 9 folder. The code is as follows: This program demonstrates the use of pointer variables It finds the area of a rectangle given length and width It prints the length and width in ascending order PLACE YOUR NAME HERE include kiostream> using namespace std; int main int length; holds length holds width int width int area; holds area int pointer which will be set to point to length int *length Ptr; int pointer which will be set to point to width int *width Ptr; continwes
Solution
lengthPtr = &length;
widthPtr = &width;
area = (*lengthPtr)*(*widthPtr);
if((*lengthPtr)>(*widthPtr))
else if((*widthPtr)>(*lengthPtr))
