• Campus Karma

Login

Write a C Program without Main()...!!

    Rohit Gupta
    By Rohit Gupta

    well all of you must be thinking i m crazy... well here is a stuff which will blow up your mind... Everyone used to study that main() is the starting point of any program... well have a look at this code... if you don't believe me then try it out yourself... the program does not have a main anywhere in the program... still it will compile and show the output screen....

    #include
    #include
    #define rohit(s,h,o,c,k,e,d) c##s##o##h
    #define happy rohit(a,n,i,m,a,l,s)

    int happy()
    {
        printf("\n Rohit loves C programming");
        getch();
        return 0;
    }

    Here's a screen shot of the program... enjoy....