I can't understand why at last question of module 3 we received 30 how? Please answer me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I can't understand why at last question of module 3 we received 30 how? Please answer me

20th Sep 2016, 11:13 AM
Masoud Hamadi
Masoud Hamadi - avatar
2 Answers
+ 1
In the Main Methode you call the method Test an pass in a as a Reference. In the First line of The Test Method the Variable x wich Points to a get assigned with 6, now the Variable a in Main method has now also the value 6. in Second line of Test you calculate 6(x) * 4(default value y). Test returns 24 and z in Main method gets assigned. At Last you Print 24+6 ->30
21st Sep 2016, 6:51 AM
Minickyi
0
I think it return to type of parameters with out type there
20th Sep 2016, 11:16 AM
Masoud Hamadi
Masoud Hamadi - avatar