clc
clear
disp('Zhoria Renfus')
k = 1;
sum_total = 0;
count = 0;
while sum_total <= 10000
term = 3^k;
sum_total = sum_total + term;
count = count + 1;
k = k + 1;
end
fprintf('Number of terms = %d\n', count);
fprintf('Total sum = %d\n', sum_total);
To embed this project on your website, copy the following code and paste it into your website's HTML: