Chapter 2
1: | What are the basic modules of a C program called? |
A1: | They are called functions. |
2: | What is a syntax error? Give an example of one in English and one in C. |
A2: | A syntax error is a violation of the rules governing how sentences or programs are put together. Here's an example in English: “Me speak English good.” Here's an example in C:
printf"Where are the parentheses?";. |
3: | What is a semantic error? Give an example of one in English and one in C. |
A3: | A semantic error is one of meaning. Here's an example in English: “This sentence is excellent Italian.” Here's a C example:
thrice_n = 3 + n; |
4: | Indiana Sloth has prepared the following program and brought it to you for approval. Please help him out.include studio.h int main{void} /* ... |
Get C Primer Plus, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.