Tuesday, January 22, 2013

Struct (5)


Complex number has the form a + bi, with a and b are real numbers. A notation called the real part and b is called the imaginary part. Create a program using structure to add, subtract, and multiply complex numbers 2 pieces.
example:
(2 +3 i) + (-1 + 3i) = 1 +6 i
(2 +3 i) - (-1 + 6i) = 3 - 3i
(2 +3 i). (-1 + 3i) = -2 - 3i + 6i + 9 i2 = -2 - 3i + 6i - 9 = -11 + 3i

========================================================================

Bilangan kompleks memiliki format a+b i, dengan a dan b adalah bilangan real. Notasi a disebut juga bagian real, dan b disebut juga bagian imajiner. Buatlah program menggunakan struktur untuk menjumlahkan, mengurangkan, dan mengalikan 2 buah bilangan kompleks. 
Contoh: 
(2+3 i) + (-1 + 3i) = 1+6 i 
(2+3 i) - (-1 + 6i) = 3 – 3i 
(2+3 i) . (-1 + 3i) = -2 – 3i + 6i + 9 i2 = -2 – 3i + 6i – 9 = -11 + 3i



Script Program :


Screenshot :

Try It and Good Luck!!!

No comments:

Post a Comment