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
YOU HAVE GIVEN THE MARKED UP PRICE OF 80% AND DISCOUNT PRICE OF 10% THEN FIND THE SELLING PRICE

What are compound statements? - Compound statements are made up of two or more program statements that are executed together. They may be executed with a loop. - Curly brack

#questio c++ program for drawing thick line

C Program for FUNCTION OF COUNT THE INTEREST float si(float,float,float); void main() {           float p=0,r=0,n=0,k=0;           clrscr();           printf("E

i am using mobile phone if i want to communicate via massage but that should be very secret

What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than a

Create an array of Strings and fill it with some interesting text, such as vacation destinations, album names, or weapon names from a CRPG. Display three elements of the array on t


write a c program to solve exanple of lamis therom

a palindrome is a string that reads the same from bhote the ends