Programming Logic C Visual Studio Values Double Variable X Following Statements Executed X Q37143081

Programming logic C# visual studio

What are the values of the double variable x after each of thefollowing statements is executed?

  1. x = Math.Abs(7.5);
  2. x = Math.Floor(7.5);
  3. x = Math.Abs(0.0);
  4. x = Math.Ceiling(0.0);
  5. x = Math.Abs(-6.4);
  6. x = Math.Ceiling(-6.4);
  7. x = Math.Ceiling(-Math.Abs(-8 + Math.Floor(-5.5)));

Solution


x = Math.Abs(7.5); -> 7.5x = Math.Floor(7.5); -> 7x = Math.Abs(0.0); -> 0.0x = Math.Ceiling(0.0); -> 0x = Math.Abs(-6.4); -> 6.4x = Math.Ceiling(-6.4); -> -6x = Math.Ceiling(-Math.Abs(-8 + Math.Floor(-5.5))); -> -14

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Please

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.