Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

Fortran Logical and Control Structures Overview UPDATED ACTUAL Exam Questions and CORRECT Answers

Document preview thumbnail
Preview 2 out of 5 pages

Fortran Logical and Control Structures Overview UPDATED ACTUAL Exam Questions and CORRECT Answers .TRUE. - CORRECT ANSWER .FALSE. - CORRECT ANSWER .TRUE - CORRECT ANSWER FALSE - CORRECT ANSWER of a logical constant. == - CORRECT ANSWER /= - CORRECT ANSWER - CORRECT ANSWER - A valid logical constant in Fortran. - A valid logical constant in Fortran. - Missing a period at the end, making it unbalanced. - Has no periods and will be treated as a variable instead

Content preview

Fortran Logical and Control Structures
Overview UPDATED ACTUAL Exam
Questions and CORRECT Answers
.TRUE. - CORRECT ANSWER - A valid logical constant in Fortran.



.FALSE. - CORRECT ANSWER - A valid logical constant in Fortran.



.TRUE - CORRECT ANSWER - Missing a period at the end, making it unbalanced.



FALSE - CORRECT ANSWER - Has no periods and will be treated as a variable instead
of a logical constant.


== - CORRECT ANSWER - A relational operator that means 'Equal to'.



/= - CORRECT ANSWER - A relational operator that means 'Not equal to'.



> - CORRECT ANSWER - A relational operator that means 'Greater than'.



< - CORRECT ANSWER - A relational operator that means 'Less than'.



>= - CORRECT ANSWER - A relational operator that means 'Greater than or equal to'.



<= - CORRECT ANSWER - A relational operator that means 'Less than or equal to'.



Relational operator return value - CORRECT ANSWER - Returns a logical value, either
.TRUE. or .FALSE.

, Relational operators functionality - CORRECT ANSWER - They compare two numerical
or character values and return .TRUE. if the condition is met, otherwise .FALSE.


Difference between == and = - CORRECT ANSWER - == is a relational operator used to
compare values, while = is an assignment operator that sets the value of a variable.


.AND. - CORRECT ANSWER - A logical operator that returns .TRUE. if both conditions
are true, otherwise returns .FALSE.


.OR. - CORRECT ANSWER - A logical operator that returns .TRUE. if at least one of the
conditions is true, otherwise returns .FALSE.


.NOT. - CORRECT ANSWER - A logical operator that negates a logical value, returning
.TRUE. if the condition is false and .FALSE. if the condition is true.


Real numbers comparison issue - CORRECT ANSWER - Real numbers should not be
directly compared using == in Fortran due to finite precision and small rounding errors.


Correct way to test equality of real numbers - CORRECT ANSWER - Use a tolerance
value and check if their absolute difference is smaller than this tolerance.


Comparing real numbers with tolerance - CORRECT ANSWER - Instead of using var_a
== var_b, use abs(var_b - var_a) < tol, where tol is a small number like 1.0e-6.


Order of operations in Fortran - CORRECT ANSWER - The sequence in which operations
are performed in expressions.


Parentheses - CORRECT ANSWER - Used to group expressions in programming.



Exponentiation - CORRECT ANSWER - A mathematical operation that raises a number to
the power of another.

Document information

Uploaded on
March 30, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES
3.8
(247)
Sold
1489
Followers
106
Items
103280
Last sold
23 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions