Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please, please help with C! Not C++!! Read the instructions and just help me wit

ID: 3832171 • Letter: P

Question

Please, please help with C! Not C++!! Read the instructions and just help me with what is asking, using what is required or functions mentioned!! Many many thanks

8. (20 pts) write a complete program to read a file of rectangles represented ength via fields and find and print the rectangle with the largest area sample file named rectangles tat given below. Each line has the Wength and width of a angle. 8.5 9.2 2.3 10.7 3.4 7.8 14.5 17.9 Output for above file should be Maximum area is 259.549988 for rectangle with length 14 sooooo and vides 17.

Explanation / Answer

#include <stdio.h>

int main()
{
FILE *fp;
fp = fopen("rectangle.txt", "r"); //file opening for read
float h,w,result;
float temph =0,tempw=0,tempr=0;
if(fp != NULL) //if file is not present
{
while(!feof(fp)) //to see end of file reach
   {
fscanf(fp,"%f %f",&h,&w);
   result = h*w;
   if(result>tempr) //checking for the rectanglw which is having maximum area
   {
       tempr = result;
       temph = h;
       tempw = w;
   }
}
}
printf("Maximum area is %.6f for rectangle with lenght %.6f and width %.6f",tempr,temph,tempw);
fclose(fp);

return 0;

}