0

How to create this kind of header files in c?

How can i use header code to i.e. make the below code work correctly?(define a function(GET) to scan n and change n mod 2 is 0 and n mod 5 is 0 to n%2==0 && n%5==0) int main() { int n; GET(n); if(n mod 2 is 0 and n mod 5 is 0) printf("OK"); else printf("Not OK"); }

7th Nov 2019, 6:27 PM
Mohammad Mahdi Masoudpour
Mohammad Mahdi Masoudpour - avatar
2 odpowiedzi
0
For custom header files. Write a function inside a separate file and store it with .h extension. Now open a new file and use the header as #include "filename.h" and use the function to perform some operations in the main method of the new file.
7th Nov 2019, 7:53 PM
Avinesh
Avinesh - avatar
0
what should i do about this code i wrote ( i want to use macros but i dont want to create another file)
8th Nov 2019, 11:13 AM
Mohammad Mahdi Masoudpour
Mohammad Mahdi Masoudpour - avatar