hello,
wondering all about C, can you demystify this
I am using turbo C
I have this code
scanf(“%d , %d”,&a,&b);
printf(“%d,%d”,a,b);
scanf(”%c”,&c);
printf(“%d,%d”,a,b);
then scanf for doesnt scan value of c
output is : 1,2
if I use this
scanf(“%d , %d”,&a,&b);
printf(“%d,%d”,a,b);
scanf(”%c ”,&c);//note a blank after %c
printf(“%d,%d”,a,b);
then it scan value of c.
output is 1,2 1,2
same code
scanf(“%d , %d”,&a,&b);
printf(“%d,%d”,a,b);
scanf(”%1s”,&c);
printf(“%d,%d”,a,b);
in this segment value of a will be displayed but value of b will be set 0
output is 1,2 1,0
can you explain the answers of both the questions.
didnt got the answers yet help me.......