Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Wednesday, January 06, 2016

Function Call by Value in C++

Function Call by Value in C++


Structure of the Problem Requirements

In pass by value or call by value copy of variables are passed to the function to perform specific operation. The actual values of the variables are unchanged and changes are made only to copied values of the variables.

Source Code 

#include<iostream>
using namespace std;
int LEP ( int a , int b)
{
 int c = a+b;
 return c;
}
 int main ()
{
 cout<<" \t \t \t LEP Tutorials \n \n  ";
 int x,y;
 cout<<" Enter Your 1st Number     : ";
 cin>>x;
 cout<<"   Enter Your 2nd Number     : ";
 cin>>y;
 //LEP(x,y);
 int sum = LEP(x,y);
 cout<<"   The Sum of Both Numbers is: "<<sum<<endl;
 }

Output of the Program

Function Call by Value in C++
Share:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List