-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquiz1.cpp
39 lines (28 loc) · 803 Bytes
/
quiz1.cpp
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
/* 2217051004
*
*/
#include <iostream>
#define minimum(x,y) x < y ? x : y;
#define maximum(x,y) x > y ? x : y;
long long rekursif(long long digitAkhir, long long digit9) {
if (digit9 == 0)
return 0;
else if (digit9 == 1)
return digitAkhir;
return digitAkhir * rekursif(digitAkhir, digit9 - 1);
}
using namespace std;
int main()
{
int a = minimum(0, 4);
int b = maximum(0, 4);
long long c = rekursif(4, 0);
const char *npm = "2217051004";
const char *str = &npm[8];
cout << a << endl; // output 0
cout << b << endl; // output 4
cout << c << endl; // output 4 kali 4 sebanyak 0 kali
cout << str << endl; // output isi dari pointer
cout << (void *) &npm[8] << endl; // output alamat dari data
return 0;
}