C Program without main()

Here's a C programming challenge: Can you write a C program without main()? If yes, post your code below and I will take a look.

Replies

  • Ankita Katdare
    Ankita Katdare
    Nick_Sharma
    Can 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 Sharma
    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
    Ankita Katdare
    Nick_Sharma
    Yes 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 Sharma
    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
    #include
    #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();
    }

You are reading an archived discussion.

Related Posts

Recently when I worked for a TEDx team, "a part" of my job was handling their social media. Everyone on the internet business is talking about 'Social Media Experts' and...
Hi there, I've completed my BSc. in Computer Science and I am currently applying for a postgraduate research degree programme in Computer Engineering. As a requirement for admission, i need...
what is the difference between object oriented and procedure oriented language
hi if there are any electrical engineer working in a powerplant preferrably in india please give some idea on laying of electrical conduit in power plant.you are most welcome to...
what is the efffect of return loss /VSWR values of an antenna on the sidelobe level performance of an antenna