Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

atjari Group Title

Can someone explain me why we put return 0?

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    And also where we put that?

    • 2 years ago
  2. agdgdgdgwngo Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    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

    • 2 years ago
  3. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    we also put system 'pause' right. then y is that

    • 2 years ago
  4. agdgdgdgwngo Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    system("pause"); is not really needed; it's used because when you run it on windows, the "cmd" window opens/closes really fast.

    • 2 years ago
  5. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    in some codings where we use sub functions we put return name, return regno etc. y is that?

    • 2 years ago
  6. agdgdgdgwngo Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    we do that because it's how we program; we compose our programs from these subroutines/procedures that return a value or change state.

    • 2 years ago
  7. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    • 2 years ago
    1 Attachment
  8. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Pls see the attachment.

    • 2 years ago
  9. agdgdgdgwngo Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    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.).

    • 2 years ago
  10. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    If u dnt mind cn u tel me in which case u use 1st one and which case u use the second.

    • 2 years ago
  11. agdgdgdgwngo Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    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

    • 2 years ago
  12. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    sorry I dnt get t.

    • 2 years ago
  13. agdgdgdgwngo Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    What I can do if I used version 2: http://ideone.com/AKT0r contrast with what i can do with version 1 http://ideone.com/AXfKR

    • 2 years ago
  14. atjari Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Thanx a lot for ur great help.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.