C expressions - assume variables are double or float, C/C++ Programming

Assume variables x, f, and d are of type int, float, and double, respectively.  Their values are arbitrary, except that neither f nor d equals +∞, -∞, or NaN.  For each of the following C expressions, either argue that it will always be true (i.e., evaluate to 1) or give a value for the variables such that it is not true (i.e., evaluates to 0).

A.    d == (double) (int) d

B.     f == (float) (int) f

C.     f == (float) -(double) -f

D.    x == -(-x)

E.     (x != -x) || (x == 0)

F.      1.0/2 == 1/2

G.    f * f >= 0

H.    (d + f) - d == (double)f

Posted Date: 4/2/2013 4:08:47 AM | Location : United States







Related Discussions:- C expressions - assume variables are double or float, Assignment Help, Ask Question on C expressions - assume variables are double or float, Get Answer, Expert's Help, C expressions - assume variables are double or float Discussions

Write discussion on C expressions - assume variables are double or float
Your posts are moderated
Related Questions
Description: Create a program that allows the user to track the hours an employee worked in a week. How much the employee was paid and any extra hours worked (overtime pay).

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Explain the Macros? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it. Usually the preprocessor performs

Lennie McPherson, proprietor of Lennie''''s Bail Bonds, needs to calculate the amount due for setting the bail. Lennie requires something of value as collateral, and his fee is 10%

Pupils' heights The health visitor at a school is going to measure the heights of all pupils. For each class she makes a statistics giving the number of pupils of each height and

what would be the best tool for debuggingg memory leaks in c/c++ programming

Explain the Bitwise-Inclusive-OR Operator: |? The bitwise-inclusive-OR operator (|) contrast each bit of its first operand to the corresponding bit of its second operand and if

Write a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

drawbacks in assignments in engeenirng

The concept of a string in C is difficult, because a string is a collection of characters stored in memory terminated by a NULL string i.e. \0. Let us consider the string Hello. Th