-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCallByValue.cpp
More file actions
60 lines (42 loc) · 1.1 KB
/
CallByValue.cpp
File metadata and controls
60 lines (42 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: homayoun
*
* Created on August 30, 2017, 11:40 AM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
int add(int Number1, int Number2);
/*
*
*/
int main(int argc, char** argv) {
int Number1(0), Number2(0);
int results(0);
cout << "Enter two Numbers: ";
cin >> Number1 >> Number2;
cout << Number1 << " " << &Number1 << " ";
cout << Number2 << " " << &Number2;
cout << endl;
results = add(Number1, Number2);
cout << Number1 << " " << &Number1 << " ";
cout << Number2 << " " << &Number2;
cout << endl;
cout << Number1 << " + " << Number2 << " = " << results << endl;
return 0;
}
int add(int Number1, int Number2) {
int something;
something = Number1 + Number2;
cout << Number1 << " " << &Number1 << " ";
cout << Number2 << " " << &Number2;
cout << endl;
Number1 = 100;
return something;
}