Unreturned Returning- 🤖read the code ; | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Unreturned Returning- 🤖read the code ;

The program will return the unreturned value after Condition. it's in c/c++; i m just giving you a pseudo code. int main() { int t; scan t; print (process (t)); //process definition below return 0; } int process(int param) { if (param>0) return 4; /*otherwise nothing!!, but it is returning Param ,i dont know why!!*/ }

15th Aug 2017, 2:46 AM
Charanjit Singh
Charanjit Singh - avatar
1 Answer
+ 1
i got my answer , I read the assembly code of that program. it gives me architecture of C compilation. the param is stored in Accumulator. and after returning control to calling function, the calling function fetch tha value at Accumulator register.Which is param if we perform some operations then it will return uts result. eg { if(param>0) return 4; param+=78; } will return value,if none of condition is satisfied, param+78. I hope you people got the logic.
15th Aug 2017, 2:52 AM
Charanjit Singh
Charanjit Singh - avatar