"Design and write a program, using functions, that calculates the area and perimeter of a rectangle whose dimensions (length and width) are provided by a user."

i created a program that allows me to do just that however, when i try to put the inputs for the length or width the inputs will not register . (pic & code attached)

any help would be greatly appreciated!

`#include `

float areaofrec( float length, float width);

float periofrec(float length, float width);

int main ()

{

/* variable definition: */

int menuSelect, intValue;

float length, width;

float result = 0;

// While a positive number

while (intValue > 0)

{

printf ("Enter a positive Integer to calculate the area or perimeter; \n ");

printf ("OR a negative Integer to exit the program.: \n");

scanf(" %d", &intValue);

if (intValue > 0)

{

printf ("Enter 1 to calculate area, 2 to Calculate the perimeter: \n ");

scanf(" %d", &menuSelect);

if (menuSelect == 1)

{

// Call the area function

printf("You chose to calculate the area of the rectangle! \n");

printf("\nPlease enter the length of the rectangle: \n ");

scanf(" %f ", &length);

printf("\nPlease enter the width of the rectangle: \n");

scanf(" %f", &width);

result = areaofrec(length, width);

printf("The area of the rectangle is %.0f \n", &result);

}

else if (menuSelect == 2)

{

// Call the perimeter function

printf("You chose to calculate the perimeter of the rectangle! \n");

printf("\nPlease enter the length of the rectangle");

scanf(" %f ", &length);

printf("\nPlease enter the width of the rectangle:");

scanf(" %f", &width);

result = periofrec(length, width);

printf("The area of the rectangle is %.0f \n", &result);

}

else

printf("Invalid menu item, only 1 or 2 is accepted\n");

}

}

return 0;

}

/* function returning the area of a number */

float areaofrec( float length,float width)

{

return length*width;

}

/* function returning the perimeter of a number */

float periofrec( float length, float width)

{

return (length*2)+(width*2);

}