![]() |
why this output
Code:
#include<stdio.h>enter number 4 9 ,4 i am trying what happens and why if i give an extra %d with nothing corresponding to it after comma , why i get this 4 as output else than e+5 which is 9 and if i use this printf statement printf("%d %d %d %d %d",e+5); i get enter number 5 10 5 -18 285 1 as far as i know printf gives -ve number on error but i get only one -ve number (compiler used turbo C) |
Re: why this output
Quote:
This may be strange to you, but programming is very literal. It attempts (and sometimes fails) to do what you ask, but it never promises to read your mind or intentions. Between the two of you, you are expected to be the smart one. |
Re: why this output
If you don't have any value for the corresponding %d its the garbage that is printed and luckily or unluckily your compiler has the 4 in the garbage location which you are printing in the code.
|
| All times are GMT +5.5. The time now is 10:45. |