in Programming in C retagged by
331 views
0 votes
0 votes
main()

{

int a;

scanf("%i"&a);

printf("%i %d",a,a);

scanf("%d",&a);

printf("%i %d",a,a);

}

suppose user entered 0x56 as input  .what is printed by above program?
in Programming in C retagged by
by
331 views

1 Answer

1 vote
1 vote
Same way here it recognizes hexadecimal value so outputs are

86 86

0 0

as decimal will see 0x56 so it will only take 0 as decimal value.

1 comment

it means as there is any character encountered scanf stops reading further?
0
0

Related questions