Erwin Harahap

do Now or Never

Bilangan kubik antara 3 dan 3.000

Posted by Erwin on September 7, 2015

Gunakan Matlab.

Buat kode sederhana berikut:

for i = 1:1000
i
i^3
if i^3 >= 3000
break;
end;
end;

Maka diperoleh bilangan sebagai berikut:

2, 8

3, 27

4, 64

5, 125

6, 216

7, 343

8, 512

9, 729

10, 1000

11, 1331

12, 1728

13, 2197

14, 2744

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: