Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

return 0 defines what

0 votes
asked Aug 14, 2018 by ganesh2000s (190 points)

1 Answer

0 votes
answered Aug 17, 2018 by Arun Sai (140 points)

The return value of the main function is considered the "Exit Status" of the application.

commented Aug 18, 2018 by Ethan Alexander Lee (580 points)
In the main function, return is a way to complete a programs functionality successful or not.
For example.

#include <iostream>
using namespace std;

int main(){
    bool fileFound = false;
    //Find file then set the bool.
    if (!fileFound){
        cout<<"Error: File couldn't be loaded."
        return 1;
    }
    //continue the program
    return 0;
}
commented Aug 18, 2018 by Ethan Alexander Lee (580 points)
returning 1 means error, while returning 0 means success.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...