Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void addOne(int &a){
- a = a+1;
- cout<<"Value of a in function = "<<a<<endl;
- }
- int main(){
- int a = 5;
- addOne(a);
- cout<<"Value of a = "<<a<<endl; // Output : 6
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement