In a exam in my course of Language Programming was this question:
Is the next program valid in a imperative programming?
int a = 0;
z = a + 2;
int z = 3;
was not specified or grammar, or syntax, or anything extra. My answer was YES because eventually there may be a language, a syntax and a grammar design for wich is valid use z without declare it and 're-declarate' z later. My grade was 0.0 but I still find it unfair. could help to clarify the issue?. Thank.
You were marked unfairly.
Paste the following code snippet into the debugger console of your browser: