S
sreelal
Dear all,
plz see the following prograam.
main()
{
int a,b;
scanf("%d %d ",&a,&b);
printf("%d %d",a,b);
}
when i run the above program on windows using Turbo C,
the program reads three numbers, ( it is expected to read two numbers only)
if i remove the white space
after the second %d in scanf statement, it reads only two.
but if there is any space after the second %d in the scanf statement
the program waits for one more number to be inputted even after I enter two
numbers.
Can anyone say why it happends?
Regards,
Lal
plz see the following prograam.
main()
{
int a,b;
scanf("%d %d ",&a,&b);
printf("%d %d",a,b);
}
when i run the above program on windows using Turbo C,
the program reads three numbers, ( it is expected to read two numbers only)
if i remove the white space
after the second %d in scanf statement, it reads only two.
but if there is any space after the second %d in the scanf statement
the program waits for one more number to be inputted even after I enter two
numbers.
Can anyone say why it happends?
Regards,
Lal