Why is the following:
int main(void)
{
double b = 11/2;
double a = 2;
printf("%lfn", a + b);
printf("%lfn", b);
}
printing, respectively, 7.000000 and 5.000000
I tried printing just the value of 5.5, without having it in a variable and then passing it to printf and it worked, but why does this code don’t?
New contributor
Guilherme Cintra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1