Final answer:
The value of cost is 2 after execution of the code snippet due to an erroneous semicolon, which causes the if-statement's block to be ignored.
Step-by-step explanation:
The value of cost after the code snippet is 2. This is because after initialization to 20 and a direct assignment to 2, the if condition checks if cost is greater than 100. Since it is not, the code inside the curly brackets should not execute. However, the code contains a semicolon after the if statement which terminates the condition, so the subsequent block that subtracts 10 from cost will execute regardless of the condition being true or false. In this case, the block is incorrectly executed, but because of the semicolon error, the final value of cost would still be 2 since the if-statement's block is isolated from the condition by the erroneous semicolon.