C Online Compiler
Example: C Program to Find Area of Rectangle using Function
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Find Area of Rectangle using Function #include <stdio.h> void FindArea(float x, float y) { // It will calculate area of rectangle float area = x * y; // It will print the final output printf("\nArea of the rectangle is: %f units\n", area); } int main() { float length, width; printf("Enter the length & width of the rectangle::\n"); scanf("%f", &length); scanf("%f", &width); FindArea(length, width); return 0; }
5 7
Output
Clear
ADVERTISEMENTS