answersLogoWhite

0

Is c program works without main function?

Updated: 8/16/2019
User Avatar

Wiki User

14y ago

Best Answer

yes a C program can work without a main() function. Though its not the normal C code that you would be writing on ur gcc or turbo C compiler.

for example Linux Source code ... does not have a main() function :

for details u can visit: http://samarthonweb.blogspot.com/2009/08/c-programe-with-no-main-function.html

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is c program works without main function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can we execute java program without main function?

no


How do you write a c program without using main function?

You cannot create a program with the extension .exe without the function main. You can create a dll which does not even use main. WinApi uses another main function but it's still a main function. Main function is entry point for your program, no entry point no program.Write a progrmme in c with out using a main function. #include #define decode(s,t,u,m,p,e,d)m##s##u##t #define begin decode(a,n,i,m,a,t,e) int begin() { printf("HELLO") }


Can you write a program without using any semicolon inside the main function?

not possible dude


Where is the fuction call of main function?

The main function is the entry point into a program. When the Operating System launches the program the main function gets executed.


How do you write a programm in c plus plus without using function main?

I don't think its possible. Every C++ program must at least have the main function.


Write a program in C without any functions?

It is not possible. In C, any program must have at least one function to be able to compile and execute properly: the function main()


What is the name of the function which must be defined in a Java program?

The main function. Every program must have a main function and it must be declared static.


What must every c program have?

A main function must be present in every C program.


Where do we write main function in a c program?

Into the source program.


Can you execute a C program without writing main anywhere in the program?

With special linker-options (platform-dependent) you might be able to create a program that has function 'Start' (for example), instead of 'main', but I don't see any reason in it.


Can you use main anywhere in the program?

No, for example it cannot be nested in:- another function definition- type-definition- variable-definitionBut, if you mean calling function main, you can do that without limits (not common practice, though).


What is main function used in c?

if you do not used main function in c program when errors are accrued