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

how to data grid use in data bind?

0 Answers   HCL,


Explain the difference between an expert and a novice user. How would your strategy for designing user interfaces for an expert user differ from that for designing user interfaces for a novice user.

0 Answers  


Write a program to implement BFS/ DFS routine in a connected graph

1 Answers  


Difference between debugging, running, executing of an application

0 Answers   HCL,


What is Big-O notation?

1 Answers  


how to stop execution of step 3 in a job mainframe

0 Answers  


What is the difference between CLEAR & RESET and OPEN & CLOSE OPCOEDS(USING RPG/400).wheare we can use this?can any body tell me in real time senario with example please?

0 Answers  


1.What is difference between symget and & in sas? 2.what is difference between callsymput and %let?

1 Answers   CitiGroup,


Write a program to swap the content of two variables without using a third variable.

0 Answers   Zensar,


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number

0 Answers   Amazon,


write a sql qwery which include joining of two tables 4 marks mainframe

0 Answers  


Caret means to you

1 Answers  


Categories