Question: Write a program that checks if an input is a legal identifier in C . Example input/output: Input: &count Output: illegal identifier Input: co%unt Output:

Write a program that checks if an input is a legal identifier in C .

Example input/output:

Input: &count

Output: illegal identifier

Input: co%unt

Output: illegal identifier

Input: count_3

Output: legal identifier

Input: 3count

Output: illegal identifier

- Name the program identifiers.c.

- Use getchar() to read in the input. The user input ends with the user pressing the enter key (a new line character).

____________________________________

1. The program should begin with a comment that briefly summarizes what it does.

2. In most cases, a function should have a brief comment above its definition describing what it does. Other than that, comments should be written only needed in order for a reader to understand what is happening.

3. Variable names and function names should be sufficiently descriptive that a knowledgeable reader can easily understand what the variable means and what the function does. If this is not possible, comments should be added to make the meaning clear.

4. Use consistent indentation to emphasize block structure.

5. Full line comments inside function bodies should conform to the indentation of the code where they appear.

6. Macro definitions (#define) should be used for defining symbolic names for numeric constants.

- For example: #define PI 3.141592

7. Use names of moderate length for variables. Most names should be between 2 and 12 letters long.

8. Use either underscores or capitalization for compound names for variable: tot_vol, total_volumn, or totalVolumn.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!