D
dam_fool_2003
#include<stdio.h>
int main(void)
{
unsigned int a=20,b=50, c = sizeof b+a;
printf("%d\n",c);
return 0;
}
out put:
24
Variable a is unchanged and + operator appends the variable b's value
(which is 4)
then throws the c value as 24.
When I change the as sizeof a+b the out put is 54. and so on.
My doubt is why is the second value (that is a) is unchanged and the
first shows the value
of sizeof(int). More correctly 4 + 20 = 24. Is there any operator
precedence involved?
If yes in what way. (I went through the precedence table but my mind
got stuck)
Posted via google so Thanks in advance
int main(void)
{
unsigned int a=20,b=50, c = sizeof b+a;
printf("%d\n",c);
return 0;
}
out put:
24
Variable a is unchanged and + operator appends the variable b's value
(which is 4)
then throws the c value as 24.
When I change the as sizeof a+b the out put is 54. and so on.
My doubt is why is the second value (that is a) is unchanged and the
first shows the value
of sizeof(int). More correctly 4 + 20 = 24. Is there any operator
precedence involved?
If yes in what way. (I went through the precedence table but my mind
got stuck)
Posted via google so Thanks in advance