1) What is Fortran?
Fortran is general purpose, high-level programming language which is used for numeric and scientific computing.
2) What are the features of Fortran programming language?
Features of Fortran language are:
- Fortran supports Numerical analysis and scientific computation
- It supports Generic and Structured programming
- It supports Array and Modular programming
- High performance
- Object oriented programming
3) Write a program in Fortran to print "Fortran Expert"?
Example:
- program TutorialandExample
- Print *, "Fortran Expert"
- end program TutorialandExample
OUTPUT:
4) Who is the inventor of Fortran programming language?
Designed by
John Backus at IBM
5) What are the types of intrinsic data types of Fortran?
There are five types of intrinsic data types are:
- Real type
- Integer type
- Complex type
- Logical type
- Character type
6) What makes Fortran a suitable language for scientific purpose?
Reasons are:
- Support for array notation
- Rich set of intrinsic functions
- Built in support for arguments in subroutines and complex numbers
7) How recursion is used in Fortran?
Recursion is used in fortran as:
- To call a function within a function
- The return location on the stack that uses the subroutine is fixed
- It has the scope of the stack that directly supports the subroutines
8) What are the changes being made in Fortran 77?
Changes made in Fortran 77 are:
- provide more flexibility in loop extensions
- IF and END IF block statements are being changed
- provides support for structured programming language
- Parameter statements are used to specify the constants
- allow direct access of Input/Output file using the implicit statements
9) What is Modules in Fortran programming language?
It is a package in Fortran where you can store your functions and subroutines.
It provides a way a splitting, where you can split your program into multiple files.
10) What are the types of Intrinsic functions are there in Fortran?
Types of Intrinsic functions are:
- Kind Functions
- Array Functions
- Numeric Functions
- Logical Functions
- Character Functions
- Mathematical Functions
- Numeric Inquiry Functions
- Bit Manipulation Functions
- Floating-Point Manipulation Functions
11) What is ABS (A) in Fortran?
It is a numeric Intrinsic function which is used to return the absolute value of A.
12) What is debugger in Fortran?
Debugger is a tool which is used to search errors in the programs. It is also used to examine the values in the variables and other data objects during execution of the program.
13) What is Kind Attribute in Fortran?
The Kind Attribute is used to specify how a number is stored internally.
14) What are the types of constants are there in Fortran?
There are two types of constants:
- Named constants
- Literal constants
- Real constants
- Integer constants
- Complex constants
- Logical constants
- Character constants
15) What is cmplx() function in Fortran?
cmplx() function is a generic function which is used to create complex numbers.
Here, The real and imaginary parts of a result are single precision.
16) What is the full form of Fortran?
Fortran stands for
FORmula
TRANslation.
17) What are the most commonly used versions of Fortran?
The most commonly used versions of Fortran programming language are:
- Fortran 77
- Fortran 90
- Fortran 95
18) What are the different types of extensions in Fortran?
The extensions used are:
- For free-form source code: .f90, .f95, and .f03
- For fixed-form source code: .f or .for
19) What is implicit none in Fortran?
implicit none: This statement allows the compiler to check that all your variable types are declared properly.
20) What are the reserved keywords available in Fortran?
Some of the reserved keywords available in Fortran are:
allocatable |
allocate |
assign |
assignment |
block data |
call |
case |
character |
common |
complex |
backspace |
close |
endfile |
format |
inquire |
open |
print |
read |
rewind |
Write |
21) What is the syntax for variable declaration in Fortran?
The syntax for variable declaration is:
- type-specifier :: variable_name
22) What are the commonly used character functions in Fortran?
The commonly used character functions in Fortran are:
- len(string)
- index(string,sustring)
- achar(int)
- iachar(c)
- trim(string)
- scan(string, chars)
- verify(string, chars)
- adjustl(string)
- adjustr(string)
- len_trim(string)
- repeat(string,ncopy)
23) What is achar(int) in Fortran?
achar(int): It is a character function which is used to converts an integer into a character.
24) What is iachar(c) in Fortran?
iachar(c): It is a character function which is used to converts a character into an integer.
25) What is the difference between lle(char, char) and lge(char, char) in Fortran?
The difference between lle(char, char) and lge(char, char) are:
lle(char, char): It is a lexical order of character which is used to compare whether the first character is lexically less than or equal to the second.
lge(char, char): It is a lexical order of character which is used to compares whether the first character is lexically greater than or equal to the second.
26) What are the Array Intrinsic Functions available in Fortran?
The Array Intrinsic Functions available in Fortran are:
- Inquiry
- Reshape
- Location
- Reduction
- Construction
- Manipulation
- Vector and matrix multiplication
27) How to create a 5 x 5 two-dimensional array of integers named matrix?
To create a 5 x 5 two-dimensional array of integers:
You need to write: integer, dimension (5, 5) :: matrix
28) What is Format Statement in Fortran?
Format Statement: It allows you to mix and match integers, characters and real output in one statement.
29) What are the Floating-Point Manipulation Functions available in Fortran?
The Floating-Point Manipulation Functions available in Fortran are:
EXPONENT (X) |
SCALE (X, I) |
FRACTION (X) |
SET_EXPONENT (X, I) |
NEAREST (X, S) |
SPACING (X) |
RRSPACING (X) |
|
30) What is DBLE (A) function?
DBLE (A) function: It is a Numeric Function which is used to convert A to a double precision real number.