Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Can we write a program without main() function?

Answers were Sorted based on User's Feedback



Can we write a program without main() function?..

Answer / rahul

no we can't write a program with out main function, this
function is the main function which usually help OS to kill
the process that has executed, like in JAVA main() is used
as a thread whose wqork is to kill the executed process and
mark those as GC( Garbage collection)

Is This Answer Correct ?    14 Yes 9 No

Can we write a program without main() function?..

Answer / rahul

no we can write a program with out main function, this
function is the main function which usually help OS to kill
the process that has executed, like in JAVA main() is used
as a thread whose wqork is to kill the executed process and
mark those as GC( Garbage collection)

Is This Answer Correct ?    10 Yes 7 No

Can we write a program without main() function?..

Answer / vignesh1988i

as for i know in C , we cant write a program wit out main()..
since whatever function we write (user defining functions).
it will start executing the statements only from the
main().... so only we will say tht FIRST EXECUTABLE FUNCTION
IS THE MAIN() FUNCTION.........

Is This Answer Correct ?    4 Yes 3 No

Can we write a program without main() function?..

Answer / gandhi gorantla

Yes we can,try it
class d
{
static{
System.exit(0);
}
}
it compiles and executes without error in java.

Is This Answer Correct ?    3 Yes 2 No

Can we write a program without main() function?..

Answer / infestant mongrel

@Rahul
In java, the job of killing the threads who have done their job (and garbage collection) is done by the java runtime environment. The main thread may even itself come to an end before all its child threads have completed their execution.

Is This Answer Correct ?    1 Yes 1 No

Can we write a program without main() function?..

Answer / samarth

yes, we can write C programs , without main() functions.
though they are not the kind of programs we use in everyday
life .For example linux kernel source code do not have any
main() function.

for details u can visit :

http://samarthonweb.blogspot.com/2009/08/c-programe-with-no-main-function.html

Is This Answer Correct ?    1 Yes 2 No

Can we write a program without main() function?..

Answer / vaibhav

no because every c prog. can compile from main function.
but when we write a code for creating a header file, we
cant use main function.

Is This Answer Correct ?    2 Yes 4 No

Can we write a program without main() function?..

Answer / revathipawar

no we cant write bcoz main() tells to the processor that it
is starting of the c programming

Is This Answer Correct ?    2 Yes 4 No

Can we write a program without main() function?..

Answer / rajkumar

I think its possiblle through macros ....like this

#define main() start
start
{
printf("Hai");
}

Is This Answer Correct ?    8 Yes 11 No

Post New Answer

More C Interview Questions

Describe the steps to insert data into a singly linked list.

0 Answers  


What is pointer & why it is used?

0 Answers  


if the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one of the item

2 Answers  


What is sparse file?

1 Answers  


What are enums in c?

0 Answers  


can we store values and addresses in the same array? explain

3 Answers   TCS,


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

0 Answers   TCS,


We can draw a box in cprogram by using only one printf();& without using graphic.h header file?

4 Answers   NIIT,


How to compare array with pointer in c?

0 Answers  


Write a c program to print the even numbers followed by odd numbers in an array without using additional array

1 Answers   Tech Mahindra,


What is a memory leak? How to avoid it?

1 Answers  


how can i get this by using for loop? * ** * **** * ******

3 Answers   Excel,


Categories