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

Write a program that calculates the area of rectangle. Your program should have

ID: 3670373 • Letter: W

Question

Write a program that calculates the area of rectangle. Your program should have functions named get_input, calculate, and display. get_input: prompts user for length and width calculate: calculates and returns the area display: displays the area to a user.

something wrong with my code..please hlep!

#include<stdio.h>
#include<conio.h>
void get_input(float *length, float *width);
void display(float);
float calulate(float length, float width);
int main()
{
   int length, width, area;

   printf(" Enter the length of Rectangle :");
   scanf("%d", &length);

   printf(" Enter the width of Rectangle :");
   scanf("%d", &width);

   area = length * width;
   printf(" Area of Rectangle : %d", area);
   getchar();
   getch();
   return 0;
}
void get_input(float *length, float width)
{
   get_input(&length, &width);
}
float calulate(float length, float width)
{
   return length*width;
}
void display(float area){
   display(area);
}

Explanation / Answer

#include<stdio.h>
void get_input(float *length, float *width);
void display(float);
float calulate(float length, float width);
int main()
{
float length, width, area;
get_input(&length, &width);
  
area = calulate(length,width);
  
display(area);
return 0;
}
void get_input(float *length, float *width)
{
printf(" Enter the length of Rectangle :");
scanf("%f", length);
printf(" Enter the width of Rectangle :");
scanf("%f", width);
}
float calulate(float length, float width)
{
return length*width;
}
void display(float area){
printf(" Area of Rectangle : %f", area);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote