Hey I tried it on the VC++ 6.0 and it ran fine without any crashes...
You tried *what* ?
and secondly I really didn't expect anything from the code... the only
thing I expect is an answer that why is it doing so???
Why is *what* doing so ?
You probably heard it before : please, please, please! quote context when
replying to other posts.
*I* will now quote parts of your previous message, since you didn't.
To answer your question : Your program is jost mostly wrong.
The inner-most scanf is evaluated first; this reads to integers into i and
j, and returns the value '2'. That's just fine.
The outer scanf gets the format string "%d %d" *plus* the return value of
the inner scanf. The expression
"%d %d" + 2
results in
" %d"
so the second scanf will try to read one integer. But you didn't tell it
where to store that integer, which is very very wrong. From this point on,
there is no telling what your program will do: it will probably try to store
a few bytes somewhere in memory, which may, or may not, set your computer on
fire.
Here more funny things will happen. You are telling printf to output two
integers, but you do not tell it *what* to print. Also undefined behaviour.
And one more : main() is supposed to return an integer. Do just that.
Ico