int a = 5;
int b = a++;
int c = ++a;
printf ("%d %d %d\n", a, b, c);
return 0
I don't understand how the out put is supposed to be 7 5 7 when the first is a and a=5
Thanks




Posted 07 February 2012 - 08:30 AM
Posted 07 February 2012 - 08:31 AM
Posted 07 February 2012 - 08:49 AM
macosxnerd101, on 07 February 2012 - 08:30 AM, said:
Posted 07 February 2012 - 09:02 AM
/*
int a = 5;
int b = a++;
int c = ++a;
printf ("%d %d %d\n", a, b, c);
return 0;
*/
int a = 5;
int b = a;
a = a + 1; // to replace a++;
a = a + 1; // This will replace the ++a
c = a;
printf ("%d %d %d\n", a, b, c);
Posted 07 February 2012 - 10:35 AM
