✏️ Explanatory Question

Can we compile a program without main() function?

👁 1,182 Views
📘 Detailed Answer
💡

Answer with Explanation

Yes, we can compile, but it can't be executed.

But, if we use #define, we can compile and run a C program without using the main() function. For example:


#include<stdio.h>    
#define start main    
void start() {    
   printf("Hello");    
}