forked from Akatakata/zerda-exam-cpp-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03.cpp
More file actions
28 lines (21 loc) · 645 Bytes
/
03.cpp
File metadata and controls
28 lines (21 loc) · 645 Bytes
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
//============================================================================
// Name : 03.cpp
// Author : Ak0s
// Description : Exam - task 3
//============================================================================
#include <iostream>
using namespace std;
void multiplier(float* a, float b);
int main() {
float total = 123;
float* p_total = &total;
float multip_number;
cout << "The number you want to multiply with: ";
cin >> multip_number;
multiplier(p_total, multip_number);
cout << "After the multiplication 'total' is: " << total;
return 0;
}
void multiplier(float* a, float b) {
*a = *a * b;
}