Issue
#include<stdio.h>
int main()
{
int i = 577;
printf("%c",i);
return 0;
}
After compiling, its giving output "A". Can anyone explain how i'm getting this?
Solution
%c
will only accept values up to 255 included, then it will start from 0 again !
577 % 256 = 65; // (char code for 'A')
Answered By - axelduch Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.