In Java, you are given the code: int random = 1; for(int i=0; i<10; i++){ random = random +random; } print(random);
What is the number printed in this program?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
For 10 times we are multiplying random by 2 so answer 2^10 or 1024