Inputting a Complex Number in Fortran 90 for DeMoivre's Theorem

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 7K views
waver.
Messages
8
Reaction score
0
i have a a little problem in fortan90 i just wanted to know how to input a complex number ( input real and img part alone ) all i want to do is to make a simple program about DeMoivres Theorem i have been around in google
all i know how to declare a argument as complex
complex a
then how to let the user input the real and img part for argument a
i did read(*,*)a
every time it give runtime error :)
thanks in advance
 
Physics news on Phys.org
A google search with fortran90 and complex returned quite a few links.

In any case, if you want to read a complex number straight into variable 'a', for example, as you show above, you need to enter your value as a complex number, i.e., enclosed in parenthesis, in other words, you type, say, "(1.43, 22.3)"
 
thanks guys for helping specially gsal i used your idea and its works thank a lot
n7vc8.jpg