Computer Science, asked by Swarup1998, 1 year ago

Write a FORTRAN77 program for exchange of values of two variables.

Answers

Answered by OrangyGirl
0

Fortran functions are quite similar to mathematical functions: They both take a set of input arguments (parameters) and return a value of some type. In the preceding discussion we talked about user defined subprograms. For

Hope it helps ✌✌❤

Answered by priyanka9432
0
A simple example illustrates how to use a function:

x = cos(pi/3.0)

Here cos is the cosine function, so x will be assigned the value 0.5 (if pi has been correctly defined; Fortran 77 has no built-in constants). There are many intrinsic functions in Fortran 77. Some of the most common are:

abs absolute value

min minimum value

max maximum value

sqrt square root

sin sine

cos cosine

tan tangent

atan arctangent

exp exponential (natural)

log logarithm (natural)

In general, a function always has a type. Most of the built-in functions mentioned above, however, are generic. So in the example above, pi and x could be either of type real or double precision. The compiler would check the types and use the correct version of cos (real or double precision). Unfortunately, Fortran is not really a polymorphic language so in general you have to be careful to match the types of your variables and your functions!


may this help u
Similar questions