Here is example of return function.
#include<iostream.h>
#include<conio.h>
int sum(int x,int y);
void main()
{
   int v1,v2,result;
   cout<<"Enter V1: ";	cin>>v1;
   cout<<"Enter V2: ";	cin>>v2;
   cout<<"Result  : "<<sum(v1,v2);
	getch();
}
int sum(int x,int y)
{
 	int s=x+y;
   return s;
}

Return Function

HOME Forums Forum Return Function

This topic contains 0 replies, has 1 voice, and was last updated by  RaksmeyChea 1 year, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #908 Reply

    RaksmeyChea

    Here is example of return function.

    #include<iostream.h>
    #include<conio.h>
    int sum(int x,int y);
    void main()
    {
       int v1,v2,result;
       cout<<"Enter V1: ";	cin>>v1;
       cout<<"Enter V2: ";	cin>>v2;
       cout<<"Result  : "<<sum(v1,v2);
    	getch();
    }
    int sum(int x,int y)
    {
     	int s=x+y;
       return s;
    }
    
Viewing 1 post (of 1 total)
Reply To: Return Function
Your information: