Return | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Return

What does return mean I donā€™t really get it and what happens if you put the return value to 1

11th Aug 2018, 9:27 PM
Ilyane
3 Respostas
+ 2
Return was created to return a value. For example you can created a function: int count() { int result=1+2; return result; } int number=count() ; //number = 3
11th Aug 2018, 9:38 PM
ThƩophile
ThƩophile - avatar
+ 1
In main() {}, return 0 is there to say that your code was correctly executed. But you can change the value.
11th Aug 2018, 9:40 PM
ThƩophile
ThƩophile - avatar
0
thanks
11th Aug 2018, 9:39 PM
Ilyane