+ 2
Is it possible to return a value from an array?
10 Answers
+ 4
Mohammad Sanei so, you mean this can't be done naa
return a[2];
i first would need to store the data from array into some variable first then
return that variable
+ 4
and x is not declared in main
+ 3
return statement is used to explicitly return data from a method (function). It causes program control to transfer back to the caller of the method, It is categorized as a jump statement,
+ 3
dont we need return value
??
what value will go in test?
show me a working code please
Mohammad Sanei
+ 3
can you make, a working code in playground