I'm sorry if it is too conspicuous but I'm a bit obscure here.
I wrote the following code:
#include <stdio.h>
int main() {
int a = 8 , b = 7 ;
int temp;
printf("%d\n", temp=a,a=b,b=temp);
return 0;
}
It gives a warning with
OUTPUT: 0
According to me, The output should have been 8
, for I've tried this kind of code printf("%d",a,b);
It prints the value of a that leads me to a conclusion that first expression will be printed with a warning of too many arguments for format.
So, In my case when temp=a
has to be the answer and hence the value of temp which became 8
should be printed.
Please explain, Where am I going wrong?
Thanks in advance for any help you are able to provide