Question:
After compiling the FORTRAN statement:
y = c/d + a*x**2-5
what will be the operator evaluated?
“FORTRAN कथन कम्पाइल करने के बाद उत्तर क्या होगा:
y = c/d + a*x**2-5”
Options:
- /
- +
- *
- **
- /
- +
- *
- **
Correct Answer: c)
Explanation:
Detailed Explanation:
The correct answer is c) * [as per the official SSC answer key].
Expression Analysis:
$$y = c / d + a * x ** 2 – 5$$
Operator Hierarchy in FORTRAN:
- Level 1 (Highest): Exponentiation (
**). - Level 2: Multiplication (
*) and Division (/) (evaluated left-to-right). - Level 3 (Lowest): Addition (
+) and Subtraction (-) (evaluated left-to-right).
Evaluation Sequence:
- The sub-expression $x ** 2$ (exponentiation) is computed first.
- Next, $c/d$ and $a * (x**2)$ are evaluated at the multiplication/division level.
- Finally, additions and subtractions occur ($c/d + [a*x**2] – 5$).
Exam Key Note: In the official answer key of SSC IMD SA 2017, option c) * was designated as the key. Candidates should recognize that in standard compiler parse trees and precedence rules, ** has the highest precedence, followed by * and /, and then + and -.
विस्तृत व्याख्या:
सही उत्तर c) * है (आधिकारिक SSC IMD 2017 उत्तर कुंजी के अनुसार)।
समीकरण का विश्लेषण:
$$y = c / d + a * x ** 2 – 5$$
फोरट्रान (FORTRAN) में ऑपरेटर वरीयता पदानुक्रम:
- स्तर 1 (सर्वोच्च): घातांक (
**) - स्तर 2: गुणा (
*) एवं भाग (/) (बाएं से दाएं क्रम में) - स्तर 3 (निम्नतम): जोड़ (
+) एवं घटाव (-)
मूल्यांकन प्रक्रिया:
- सर्वप्रथम $x ** 2$ का मान निकाला जाता है।
- तत्पश्चात $c/d$ और $a * (x**2)$ गुणा/भाग स्तर पर निष्पादित होते हैं।
- अंत में जोड़ और घटाव की प्रक्रिया पूर्ण की जाती है।
परीक्षा संदर्भ: आयोग द्वारा जारी उत्तर कुंजी में c) * को सही माना गया था। मानक नियमों में ** की वरीयता * और / से अधिक होती है।