![]() These reserved words cannot be used as identifiers or names. Keywords are special words, reserved for the language. It must be composed of alphanumeric characters (all the letters of the alphabet, and the digits 0 to 9) and underscores (_).įirst character of a name must be a letter. A name in Fortran must follow the following rules − IdentifierĪn identifier is a name used to identify a variable, procedure, or any other user-defined item. A token could be a keyword, an identifier, a constant, a string literal, or a symbol. Tokens are made of characters in the basic character set. the special characters = : + blank - * / ( ).The basic character set of Fortran contains − ![]() Fortran is case-insensitive, except for string literals. However, fortran assumes that when you come to the end of a specifier list that you want to start a new line. Indentation of code lines is a good practice for keeping a program readable.įortran allows both uppercase and lowercase letters. The print * command displays data on the screen. You must always use implicit none at the start of every program.Ĭomments in Fortran are started with the exclamation mark (!), as all characters after this (except in a character string) are ignored by the compiler. The implicit none statement allows the compiler to check that all your variable types are declared properly. When you compile and execute the above program, it produces the following result −Īll Fortran programs start with the keyword program and end with the keyword end program, followed by the name of the program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |