0
How to get results inside function??
How can I get return result inside function??
4 Respuestas
+ 1
You can define your function as a float or a double returning function, then return that data type with:
return result;
inside the function. If you want to print it out, you can store the return value from the function into a variable and use cout:
float/double stored_value = function (inch, cm);
cout << stored_value ;
or just use:
cout << function(inch, cm);
Printing it inside the function is the same, only inside the function instead. Just do:
cout << result;
in the body of the function.
NOTE: this isn't actual working code, just a generic idea of what you should be looking for.
0
I dont understand what you are asking. Can yoh give an example of what you are trying to do?
0
Some one gave me this problem I know how to convert inch to cm but there is a condition in last so I can't understand that condition??2. Write a program which take input from user to convert the inches to centimeter using a
function. The results must be printed inside the function.
0
Okay