Created
July 10, 2021 13:48
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include "circle.c" | |
#include "circle.h" | |
int main() | |
{ | |
float r = 4.0; | |
printf("%.2f", circle_area(r, PI)); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double circle_area(float r, float PI) | |
{ | |
return (PI * r * r); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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