0
why we use "return" for ??? and please define it as you understand
3 Respuestas
0
Without return , the loop will carry on working wasting all the resources......Take care never remove the last return Zreo of the int main() given with that C++ standard coding used in that class...
why not publicizing your codes for me to see ????????
+ 1
return is used with functions in c++. Most of the functions are designed to input a value process it and then output the processed result. The return statement gives(or more appropriately returns) the output value of a function.
for example consider a function:
int myFunction(int a)
{
return a*2;
}
int main()
{
cout << myFunction(6)
return 0;
}
Outputs 12
now myFunction() whenever used in a program will return the doubled value of it's parameter as seen above.
+ 1
return is used to tell the program or class the final result, for the main function this is mostly to tell the program it's finished all its function