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
solve for radius(R) of a circle of its area is to be inputted by a user. also display compute the circle diameter hint: area= pir21 pi=2.1416

write a program to find the area under the curve y=f(x) between x=a and x=b integrate y=f(x)   #include float start_point, /* GLOBAL VARIABLES */

Project Description: We want to generate premium numbers for one of our application. What we need is: A program that generate 2, 3, 4, 5, 6, 7, 8 digits premium numbers

New data members  New member functions  New constructors and destructor  New friends

Q: But MFC appear to encourage the employ of catch-by-pointer; should I do the similar? A: Depends. If you're utilizing MFC and catching one of their exceptions, by all means, d

develop a program read the following information from the keyboard in which base class consist of employee name code and destingnation the derived class contain the data members th


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

Aim: To implement a program to create, update & display account & admin record of person using display account & admin records of person using virtual base class.. Code:

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b