return program
-
i want to know here that when i write a function like this
int add (int a,int b) { int sum=0; sum=a+b; return sum; }
i return sum but return sum to where.... that what i hope to know thank's for all To Be Or Not To Be (KARFER)When you need to post a code you can use of
pre
and dont need to post again.;)
WhiteSky
-
i want to know here that when i write a function like this
int add (int a,int b) { int sum=0; sum=a+b; return sum; }
i return sum but return sum to where.... that what i hope to know thank's for all To Be Or Not To Be (KARFER)since you are returning an integer data type, you can call the function to an integer like: int s; s=add(2,3); where you pass 2 and 3 as integers and get 5 as the sum which is stored in the variable s. The add function can be called from any other function or main method. hope that helps.