Fortran Input a polynomial into FORTRAN?

AI Thread Summary
Inputting a polynomial directly into the command prompt in FORTRAN is not a standard feature. However, users can create a custom subroutine that accepts the polynomial degree and a vector of coefficients as arguments. An alternative approach is to read polynomial data from a text file, which can streamline the input process and reduce errors during data entry. Additionally, searching for "FORTRAN read command line" may yield helpful resources for implementing input methods.
danerape
Messages
31
Reaction score
0
Input a polynomial into FORTRAN?

Hello all, I took a Fortran programming class last semester and can write Fortran well. However, I never recall anyone ever asking if there would be a way to input a polynomial into the command prompt. I'm assuming there is not. It would be great though. I have written an entire diff and int program that can do logs,trig,exp,inverse, basically everything. I still have to chose what kind of diff/int, the degree and input each coefficent on its own. Would be nice to just enter a poly and hit enter.

THANKS
 
Technology news on Phys.org


You could write your own subroutine to do it. You could use a function with two arguments, an integer (polynomial degree) and a vector of the coefficients.
 


It is not the solution you requested, but couldn't you just have the program open and read from a text file? It would save you the trouble of constantly entering the data one-at-a-time, possibly making typos, etc. That is what I do, especially during the debugging phase of writing a program.

Alternately, I did a Google search for

fortran read command line

and came up with many results. Perhaps there is something there that can help you.
 
Last edited:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top