Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - If you assign a character data to an integer variable, what will you get after outputting the variable?
If you assign a character data to an integer variable, what will you get after outputting the variable?
If the input is a letter, I won't get the input.

k = scanf("%d ",& ampI); Scanf returns 0 to k. printf("%d\n ",k); Type 0.

If the input is executed correctly, k gets 1.

printf("%d\n ",I); The printed value is not necessarily what it is, which is determined by the way the compiler handles it. Maybe it's 4223 160, maybe it's another meaningless value.