why main() method should not return any value

Answers were Sorted based on User's Feedback



why main() method should not return any value..

Answer / nadeem khokhar

execution starts from the main function. no function can call it, which means no function can save the returned value from main. then why should we take its return type as we can not use that any where! i do agree to jhill123 that in C we write int main instead of void main, it is used for exception handling.

Is This Answer Correct ?    4 Yes 2 No

why main() method should not return any value..

Answer / jhil123

It is possible if we declare main() function return value
as void. This is because the default return value of main
function in C is int and if one declares it as void it
results in mismatch in declaration and so cannot be
declared as void.

Is This Answer Correct ?    6 Yes 7 No

Post New Answer

More Programming Languages AllOther Interview Questions

what is the difference between set and append?

3 Answers   ICICI,


what is difference between IF-ELSE-ENDIF and IIF.

2 Answers  


9.Difference between even and odd signals?explain with the diagram?

0 Answers  


Hi can you please help for the following. I have a ASP.Net web page I want to print the whole page how is it possible? I want It in ASP also.Please send me the solutions dipankar.hazari@gmail.com . Thanks in advance.

0 Answers   Philips,


I am looking for selenium RC online Training in chennai. can any one tell me the best institute

0 Answers  






this question is from sas:what is the difference between FILE and INFILE statements? plz explain in brief?

1 Answers  


Write a program to calculate the following i want a Java program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)

4 Answers   HTC,


In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?

0 Answers  


73. How can you set the status and title for a modal dialog box? a) In the attributes of the corresponding screen. b) Before the corresp. call screen statement. c) In a PBO module of the corresponding screen. d) In the PAI module of the corresponding screen.

1 Answers  


why we use new keyword for object

4 Answers   TCS,


what is diff bet ref variable & instance of class

0 Answers  


can anyone please tell me the procedure for the NIC personal interview as i have been selected for the post of scientist/technical assistant B

2 Answers   NIC,


Categories