0

I'm having some trouble with the output here...can anyone help me...learning how to use to C language, more of a C++ programmer...i tried using all sort of declaration but the output is still the same...

int i;
    float x = FLT_MAX - (2.0);
    double 	y = DBL_MIN - (2.0);
    long double z = LDBL_MAX -(2.0);
 
    printf("==================================\n");
    printf("Inside Loop 1\n"); 
    for (i=1; i<=5; i++) {
        x = x + 1.0;
        y = y - 1.0;
        z = z + 1.0;
	printf("i = %d \t x = %f \n", i, x);
        printf("i = %d \t y = %e \n", i, y);
        printf("i = %d \t z = %Lf \n\n", i, z);
    }
    x = x - 100.0;
    y = y + 100.0;
    z = z - 100.0;
    printf("After Loop 1\n \t x = %f \n\n", x);   
    printf("After Loop 2\n \t y = %e \n\n", y);
    printf("After Loop 3\n \t z = %Lf \n\n", z);
}

thanks guys...

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by kings_mitra
0

well then,

what actually is wrong with your output? Why not posting this?

Knowing your compiler would be a great help too. Indeed, there are such twerps still not knowing long double. Also there are some convention such as l or L or typecasting when processing long double.

-- tesu

Edited by tesuji: n/a

0

First of all, U hv not provided the whole code. I mean u hv left the initial few lines frm ur code. U need to include <float.h> to get an access to the Macros. Also main itself is missing ???
Secondly, what is ur problem output, as I am not getting anything wrong with it.

Specify ur problem clearly.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.