Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Can someone explain me why we put return 0?

Computer Science
See more answers at
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this and thousands of other questions

And also where we put that?
programs return 0 when they exit to let the OS know that it has terminated successfully and nothing has gone wrong. something like "return 0" should exist somewhere within the main function of your C/C++ program
we also put system 'pause' right. then y is that

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

system("pause"); is not really needed; it's used because when you run it on windows, the "cmd" window opens/closes really fast.
in some codings where we use sub functions we put return name, return regno etc. y is that?
we do that because it's how we program; we compose our programs from these subroutines/procedures that return a value or change state.
1 Attachment
Pls see the attachment.
you do get similar output in both programs, with slight differences in the way the functions work (second one has string exist in one frame, etc.).
If u dnt mind cn u tel me in which case u use 1st one and which case u use the second.
With the first one, you can reuse the display() function if you ever want to get string input from the user. With the second one, you use it if you want to reuse the ability to have the user enter a string, and then echo it as "Name is\t" + hisname
sorry I dnt get t.
What I can do if I used version 2: contrast with what i can do with version 1
Thanx a lot for ur great help.

Not the answer you are looking for?

Search for more explanations.

Ask your own question