Arduino error: expected '(' before numeric constant

You shouldn't use single letters for variable names. You definitely shouldn't use single capital letters. Many of those are already defined as macros in the core. When they get expanded into what you though was a variable name the errors that are produced can be crazy hard to figure out. Give your variables descriptive names so you know what they represent.