English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

#include
main()
{
int a=5;
a=(--a)-(a--);
printf("%d",a);
}

2007-01-08 02:07:29 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

it should print. I don't know I give up.

2007-01-08 02:14:53 · answer #1 · answered by aplusjimages 4 · 0 0

well, the a value assignment is easy, --a=4 - a--=4 (it should reassign 3 after the value is read, but since were reassigning to a, it doesn't matter), a=0. now, the printf function should print a signed decimal integer: 0.00

Cheers

2007-01-08 10:25:24 · answer #2 · answered by Julio M 3 · 0 0

Answer is Zero.

Reason:-
--a-> indicates pre-decrement. so it will decrement and also assign. so now value of a=4,
(--a)-(a--)
4-(4--);
a-- => will be decremented only after seeing semi-colon
so at present a=4-4 =0
so again, after semicolon a gets decremented.
So a=-1
When u are printing, you are printing it as integer ie. %d, so answer will be zero. ( i am not sure about the printed answer) but the rest of the steps are correct.

2007-01-08 12:37:12 · answer #3 · answered by Sudha P 2 · 0 0

zero

2007-01-08 10:21:06 · answer #4 · answered by kedar 2 · 0 0

fedest.com, questions and answers