Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Ankita Katdare

    @abrakadabra • Mar 15, 2012

    Nick_SharmaCan you write a C program without main() ??

    We had a similar thread for JAVA.
    Check : #-Link-Snipped-#

    It is quite possible to write a C program without main() if we know how to use preprocessor and macro.

  • Neeraj Sharma

    @neeraj-iAaNcG • Mar 15, 2012

    Yes it is possible using macros.I wanted it to be a kind of quiz ๐Ÿ˜› Sorry may be I posted in wrong section ๐Ÿ˜”

  • Ankita Katdare

    @abrakadabra • Mar 15, 2012

    Nick_SharmaYes it is possible using macros.I wanted it to be a kind of quiz ๐Ÿ˜› Sorry may be I posted in wrong section ๐Ÿ˜”

    This is the right section. ๐Ÿ‘
    Let us keep this open for responses.

  • Neeraj Sharma

    @neeraj-iAaNcG • Mar 16, 2012

    This is actually the solution. Yes, we can write a program without main logically but it is not possible conceptually..
    Here is the program:

    #include<stdio.h>
    #include<conio.h>
    #define decode(a,u,d,i,b,l,e) i##a##d##u
    #define START decode(a,n,i,m,a,t,e)
    void START()
    {
    clrscr();
    printf("Hey this is Nick waving hi from a program without main");
    getch();
    }