← Back to Analisis Kode
Prev

Question 18 — Kebersamaan

Analisis Kode · 20 points · Answer key: 31

Next

Question

#include <iostream>
using namespace std;
int a = 4, b = 3, c = 7, d = 2, ans = 0;
void keb(int x) {
    ans += a;
    int temp = a;
    a = b;
    b = c;
    c = d;
    d = x;
}
int main() {
    keb(5);
    keb(2);
    a += 2; c += 3;
    keb(3);
    d += 4; c += 4;
    keb(0);
    a += 5; b += 6;
    keb(1);
    c += 9; a += 7; c += 2;
    cout << ans << endl;
    return 0;
}

Jawab: …………………………………………………… {tuliskan output program}

Answers (7 members)

MemberAnswer
Yazid31
Habibie31
Kian31
Algazel31
Athar31
Priscilla31
Athmar40