Effect of one control specification on another in printf statement.
CASE A :
-1202590843,-38367267551084304000000000000000000000000000.000000,0.000000
Output in B:
8,8.987654,0.000000
how is the value to be printed differing in both cases that is when i give wrng value fr %d conversion specification in CASE A ,then it also prints wrong value of its immediate format string ,so here %f tries to print some wiered value each time while the other % lf coreesponds to print the value 0.000000 so hw is it that this %d format string affecting the values to be printed corresponding to other format strings ,becoz when in CASE B ,on giving correct value for %d remove,i m getting crect answers .
#include<stdio.h> #include<conio.h> int main() { int y = (8,9); printf("%d ,%f , %lf", 8.76, 8.987654); getch(); return 0; }CASE B:
#include<stdio.h> #include<conio.h> int main() { int y = (8,9); printf("%d, %f, %lf",8 , 8.987654); getch(); return 0; }Output in A:
-1202590843,-38367267551084304000000000000000000000000000.000000,0.000000
Output in B:
8,8.987654,0.000000
how is the value to be printed differing in both cases that is when i give wrng value fr %d conversion specification in CASE A ,then it also prints wrong value of its immediate format string ,so here %f tries to print some wiered value each time while the other % lf coreesponds to print the value 0.000000 so hw is it that this %d format string affecting the values to be printed corresponding to other format strings ,becoz when in CASE B ,on giving correct value for %d remove,i m getting crect answers .
0