English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

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; n = x + y / x; - Computer Science

Advertisements
Advertisements

Question

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;

n = x + y / x;

Sum

Solution

n = x + y / x;
= 5 + 4/5
= 5 + 0 (both x and y are int type. Therefore only integer part of quotient is considered)
= 5

shaalaa.com
  Is there an error in this question or solution?
Chapter 9: Introduction to C++ - Data Types, Variables and Expressions - Evaluation - Section - C [Page 151]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 9 Introduction to C++
Data Types, Variables and Expressions - Evaluation - Section - C | Q 3. (i) | Page 151
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×