Technically it's both. It's a vegetable when it's ripe and eaten off of the cob or cooked. Once it's "dried" it becomes a grain, i.e. cornmeal, or pre-popped popcorn. Most people eat corn when it's still a vegetable, with the exception of popcorn or when it's processed into something like tortillas or corn chips.
If it has carbs in it - count them. How hard is that?