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
d) a "static destructor" is a static member function of the class which accepts one argument - a pointer to the object of that class to be cracked. It is probably utilized along wi

Project Description: I will need a tutor that would help me out in Data Structure and learning Algorithm more at the mathematical/algorithmic level. The book is written by "by T

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Define the Arithmetic Operators in c Language? There are five arithmetic operators in C and they are Operator             Purpose +                        Addition -

Project Description: I posted listings on a site that is like eBay but for video games. I post the similar listing many times daily, but need something that will let me post

The following is the formula that can be used to complete that calculation: Monthly Payment = Monthly Interest Rate / (1 - (1 + Monthly Interest Rate) -Payment Interval )) *

Ask question #write statement that assign random integer to the varaible n in the (100

Write a program to calculate the timetable for numbers 1 -> 10 and display them as follows. Your solution should use for do loops      #include stdio.h void main() {    char p

Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.