Answer:
int rectArea (int len, int wid)//Function
{
return len*wid;//return statement.
}
//Main function to test.
int main()
{
printf("The area of a 6 by 10 rectangle is %d",rectArea(6,10));
return 0;
}
Step-by-step explanation:
- The above function code is in c language, in which there is one return statement which returns the product of the len and wid variable, which is the area of a rectangle.
- When a user wants to run this program then he needs to mention a header file as studio.h and write the program on c editor and then compile and run that program.
- The user also needs to define the main function and call this function as shown in the above code, then this code will be run successfully.