0% found this document useful (0 votes)
4 views5 pages

Function Include

The document outlines the creation of three C programming files: LabF.c, Operation.c, and Operation.h. LabF.c contains the main function that performs addition using a function declared in Operation.h and implemented in Operation.c. The document also includes the necessary commands to compile the files using gcc.

Uploaded by

nonamo1102001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Function Include

The document outlines the creation of three C programming files: LabF.c, Operation.c, and Operation.h. LabF.c contains the main function that performs addition using a function declared in Operation.h and implemented in Operation.c. The document also includes the necessary commands to compile the files using gcc.

Uploaded by

nonamo1102001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

First step

Create three files


1- LabF.c
2- Operation.c
3- Operation.h
File one
LabF.c

#include <stdio.h> //Standard library


#include “Operation.h” // user define library to use all function in Opeartion.h

int main()
{
int Num1 = 10 , Num2 = 20 , Result ;
Result = ADD(Num1,Num2); // Call function do addition
printf(“Result = %d”, Result);
}
File Two
Operation.h // File have declaration of functions

int ADD(int Number1 , int Number2);


int SUB(int Number1 , int Number2);
int MUL(int Number1 , int Number2);
int DIV(int Number1 , int Number2);
File three
Operation.c // file have implementation of function
#include "Operation.h"
int ADD(int Number1 , int Number2)
{
return Number1 + Number2 ;
}
int SUB(int Number1 , int Number2)
{
return Number1 - Number2 ;
}
int MUL(int Number1 , int Number2)
{
return Number1 * Number2 ;
}
int DIV(int Number1 , int Number2)
{
return Number1 / Number2 ;
}
CMD
• gcc LabF.c Operation.c

You might also like