Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Home » Forum » x-Forum » Question


In some programs, We defined n=temp; where to keep the value of n remain unchanged and used it later as temp but i have just saw few programs where we defined some other value, Let say K=prnfunction(n), So now if we printf( %d, k ), it will take the value from prnfunction(n) ? can anyone explain, What s the difference and how to know that

Posted by neeraj019 2019-04-28 13:20:28


Here prnfunction(n) will return some value, which is assigned to K. prnfunction(n) will do some operation and return some value, and to use the value we store it in some variable like K here. let me know if you have any questions.

C++ user image Admin posted 2019-04-28 13:27:07


Here when the line K=prnfunction(n) comes to execution it calls the function prnfunction(n) , so it will go to that function definition and it will process the lines of code which were there and then it will returns the value to same line and it got assigned to k. Now the k value is the return value of the function.

 Its my understanding, @Admin Please Acknowledge  this if i am wrong.

C++ user image Gowthami posted 2019-07-10 03:35:27

Please login to comment

Log In

Ask New Question