C++ : Function call by value

in #programming9 years ago

Today i am going to share a simple function program with you i hope you will like this .



#include<iostream>

using namespace std;

int add(int , int );

int main()

{

int a , b , c;

cout<<"Enter values \n";

cin>>a>>b;

c = add(a , b);

cout<<"sum : "<<c;

c = add(a , b);

cout<<"add ="<<c;

}


int add(int x , int y)

{

int sum = x + y;

return sum;

}


Output : 

Enter values 

5

sum : 3 + 5 = 8

Sort:  

thanks : can you under stand programming language ???

No, I have not learned them, but have made their cows

This post has received a 3.83 % upvote from @boomerang thanks to: @wajahatsardar

@boomerang distributes 100% of the SBD and up to 80% of the Curation Rewards to STEEM POWER Delegators. If you want to bid for votes or want to delegate SP please read the @boomerang whitepaper.

Coin Marketplace

STEEM 0.04
TRX 0.31
JST 0.074
BTC 63337.80
ETH 1663.24
USDT 1.00
SBD 0.41