1 KB = 2(10) and 1 MB = 2(20). Java provides a simple operator to multiply by two better know as the left shift operator.
So the code snippet that does the trick is,
int oneMB = oneKB<<10;
So the code snippet that does the trick is,
int oneMB = oneKB<<10;
The other answer that I got is,
int oneMB = oneKB+1047552; which look like a neat enough way to solve the puzzle!
Leaders board to be updated with the next post.
No comments:
Post a Comment
Solution for this question?