Write a C program to run without main() function






How to make a program in C and C++ without any main() function



 Here is an example of C and C++ program which run without main() function .




#include<stdio.h>
#define  main  my // macro declaration


void  my()
{
    printf("Hello C Language");
}




The above code runs because we defined main as my and at the time of compilation "my" is interchanged to "main". 



Comments

Popular posts from this blog

Binary Search Program in C, C++

Write a Program to Reverse a String Using Stack

Print Prime Numbers Between 1 to 100 in C, C++