Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LokeshKumarES/ed67ba195a40e2d0e7ccc4697ea4b7e1 to your computer and use it in GitHub Desktop.
Save LokeshKumarES/ed67ba195a40e2d0e7ccc4697ea4b7e1 to your computer and use it in GitHub Desktop.
We have two cases where we use file inclusion: a. If programer is dealing with a very large program. b. If similar functions and macro definitions are using frequently.
#include<stdio.h>
#include "circle.c"
#include "circle.h"
int main()
{
float r = 4.0;
printf("%.2f", circle_area(r, PI));
return 0;
}
double circle_area(float r, float PI)
{
return (PI * r * r);
}
#define PI 3.14159265358979323846
double circle_area(float, float);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment