Initial value of x=4
repeat(4){ x = 2 * x + 3; }
This line means the mathematical operation is done for 4 times.
First:
Put x=4
x=2*4+3=11
Now value of x=11
Second:
Put x=11
x=2*11+3=25
Now value of x=25
Third:
Put x=25
x=2*25+3=53
Now value of x=53
Fourth:
Put x=53
x=2*53+3=109
Now value of x=109
Hence ,after execution of code
the following is printed:
109
Comments
Leave a comment