TheBullDoza All American 7117 Posts user info edit post |
that i need help on
Question: What is the shortest possible Fortran program
I was thinking
Program "_____" Print "_____" End
halp!! 6/1/2010 10:01:27 PM |
FykalJpn All American 17209 Posts user info edit post |
you don't need the print, but you do need a stop, n'est-ce pas? 6/2/2010 1:33:53 AM |
TheBullDoza All American 7117 Posts user info edit post |
How come? When i run a program with the same format as above and leave out the STOP, it acts the same as if the word STOP was in the program 6/2/2010 6:05:22 AM |
meliorist New Recruit 26 Posts user info edit post |
Is this a CS question, like, write a the shortest possible program (in bits) or is it just a pedagogical question?
Does it count as a program if if just makes an assignment? PROGRAM z a=1 END 6/2/2010 9:34:11 AM |
Wraith All American 27257 Posts user info edit post |
^You'd have to declare a in that case
I don't think you would actually even need anything in the body.
Program X EndProgram X 6/2/2010 10:14:42 AM |
meliorist New Recruit 26 Posts user info edit post |
you should declare the variable, at least for writing in fortran77. I think in f95 too you can manage to not declare variables.
But Wraith is probably right about the short program having no body:
Quote : | "PROGRAM x END PROGRAM " |
compiles.6/2/2010 12:15:49 PM |
factotum New Recruit 38 Posts user info edit post |
The answer, for Rodman's class, is in his notes which are online.
http://courses.ncsu.edu/csc112/lec/051/
Select Lecture Notes 0 - Intro
-----
Let’s return to step 5, implementation. Here is how I write Fortran programs.
First I name the program: Area_of_a_triangle. Then I write three lines of code that I know will compile plus comment.
PROGRAM Area_of_a_triangle ! Documentation – follow guidelines in lab IMPLICIT NONE END PROGRAM Area_of_a_triangle
-----
Since ^ did it in two lines, I asked Rodman and his response was .... two lines is the minimum but he requires all programs for his class to have the two middle lines. 6/2/2010 3:12:56 PM |
lion4russell All American 1588 Posts user info edit post |
i had rodmans class.
PROGRAM fuckrodman IMPLICIT NONE END PROGRAM fuckrodman 6/2/2010 9:33:53 PM |
AstralAdvent All American 9999 Posts user info edit post |
lol
I'm AstralAdvent and i approved this message. 6/2/2010 11:03:41 PM |
TheBullDoza All American 7117 Posts user info edit post |
YOU LAUGHING AT ME????
anyways...Thanks for the help everyone 6/3/2010 7:30:59 PM |