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
Additional keywords in C++ Class     friend    virtual   inline private  public    protected     const this         new       delete   operator The actual use and expl

WAP TO PRINT THE LARGEST NUMBER FROM ANY 10 NUMBERS #include stdio.h> #include conio.h>   void main()   {                    int a[10],i,max;

Ask question #M i want to undersatnd about tree structures like node leaf etcinimum 100 words accepted#

how to make a diamond from steric

write a c program that multiplies 3 martices

Program is to swap the two values which are enter by user: Program is to swap the two values which are enter by user through the function with values changed using pointers

Get Reverse Engineer to Linux game routine analysis Project Description: I want a fast and efficient reverse engineer with good knowledge of assembly x86 language, strong rev



If you have computed a number (stored as a ?oating-point value) and want to display this on a plot (i.e. as a character string) you have to convert it into a STRING. That is we wan