Hi,
I spotted that when I use a typecasting in printf the next printf behaves according to that typecasting. I wonder why. Thanks. Here is a 2 example.
If you comment out second printf the third printf's output changes accordingly.
I spotted that when I use a typecasting in printf the next printf behaves according to that typecasting. I wonder why. Thanks. Here is a 2 example.
If you comment out second printf the third printf's output changes accordingly.
Code:
#include <stdio.h>
#include <stdlib.h>
#define RECT_AREA(x, y) (x)*(y)
int main(int argc, char *argv[]){
printf("%f\n", RECT_AREA(10, 5));
printf("%f\n", RECT_AREA(10.0, 5));
printf("%f\n", RECT_AREA(10, 5));
return EXIT_SUCCESS;
}
Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
printf("%f\n", 10*5);
printf("%f\n", 10.0*5);
printf("%f\n", 10*5);
return EXIT_SUCCESS;
}