Interview Question


Country: India




Comment hidden because of low score. Click to expand.
3
of 3 vote

'return' statement is generally used to return from the current function to its caller. return <expression>; will return the value of the expression to its caller. Its generally a good coding practice to use only one return statement per function. Too many return statements would lead to a kind of confusion.

'exit()' is used to terminate the execution of the current function and return to the operation system.

- Venkata Pavan April 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

'return' is used to return a value from a function, where as 'exit' is used to come out of a block or to terminate a loop.

- VMK April 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

return statement is a programming language statement used to return control from the called function to the calling function

exit is a system command to kill the process in execution.

- Anonymous April 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

return statement return the control to its parent function where as the exit() is used to get out from the programme ......safely or forcefully

- Chittarnajan April 17, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More