C Identifiers
An identifier is a name created by the programmer. Examples include variable names, function names, array names and structure names.
Valid identifiers
- studentName
- total_marks
- _count
- marks1
- calculateTotal
Invalid identifiers
- 2marks – starts with a digit
- student name – contains a space
- total-marks – contains hyphen
- int – keyword
Program example
| #include <stdio.h> int main() { printf(“Age = %d\n”, studentAge); return 0; |
| OUTPUT Age = 21 Marks = 456.50 |
| ⭐ EASY TIP: Use meaningful names. studentAge is much easier to understand than x. |