मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता ११

Evaluate the following C++ expressions where x, y, z are integers and m, n are floating-point numbers. The value of x = 5, y = 4 and m = 2.5; z *= x * m + x; - Computer Science

Advertisements
Advertisements

प्रश्न

Evaluate the following C++ expressions where x, y, z are integers and m, n are floating-point numbers. The value of x = 5, y = 4 and m = 2.5;

z *= x * m + x;

थोडक्यात उत्तर

उत्तर

z = (x++) * m + x;
= 5*2.5 + x
= 12.5 + 5
= 18 (z is int type, therefore the fractional part is removed, X++ is incremented after the addition)

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 9: Introduction to C++ - Data Types, Variables and Expressions - Evaluation - Section - C [पृष्ठ १५१]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 11 TN Board
पाठ 9 Introduction to C++
Data Types, Variables and Expressions - Evaluation - Section - C | Q 3. (iii) | पृष्ठ १५१
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×