Yes, you read it right. Seems impossible ? Nothing is impossible. Though it seems meaningless to write C Program without main Function . Every Program Must have Main Function as it is Entry Point of Every C Program. All Predefined and User-defined Functions are called directly or indirectly through the main.
Below is the program to write C program without main function
#include<stdio.h>
#define begin main
int begin() {
printf(“Hello”);
return (0);
}
Save C Program using Extension .C
Explanation to the program :
• Before Program is given to compiler program is processed by Preprocessor .
• Source Program is scanned from Left to Right and from Top to Bottom and “begin” is replaced by “main”
- MongoDB Operators Tutorial – What are Different Operators Available? - October 5, 2019
- MongoDB Projection Tutorial : Return Specific Fields From Query - March 9, 2019
- MongoDB Index Tutorial – Create Index & MongoDB Index Types - July 6, 2018