Skip to content
KnowledgeCity

Programming with C: Syntax

Gain an understanding of C's syntax so you can write program statements that compile and run.
Preview the first lesson free — get full access to all 4 lessons.
Course: On-Demand
Intermediate Provider Mike McMillan  4 Lessons ·  11m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

In these lessons, we’ll begin by explaining C's block structure—most programming constructs are formed around blocks, which are groups of C statements that are part of a logical unit. Blocks also control how variables are seen by different parts of a program.

Next you’ll learn to write grammatical C statements using different syntactical structures such as curly braces and semicolons. We’ll then discusses the use of the comma, both as a separator when declaring variables and for indicating when two or more programming statements should be taken together, as if they are executing at the same time.

We’ll conclude with a discussion of various syntactical features of C including keywords, identifiers, the use of whitespace to make programs more readable, and using constants to distinguish important data.

What You'll Learn

  • Understand C's block structure and how it affects the variables used in a program
  • Write grammatical C statements using syntactical structures such as curly braces and semicolons
  • Recognize the various uses of the comma in C programming, both as a separator and as the comma operator
  • Apply miscellaneous C syntax features including keywords, identifiers, whitespace, and constants

Key Takeaways

  • Blocks are groups of C statements that form a logical unit, and most programming constructs are formed around blocks.
  • Block structure controls how variables are seen by different parts of a program.
  • The comma is used as a separator when declaring variables and to indicate that two or more programming statements should be taken together as if executing at the same time.
  • Whitespace can be used to make C programs more readable, and constants help distinguish important data.
  • Grammatical C statements are formed using syntactical structures such as curly braces and semicolons.

Frequently Asked Questions

What topics does this course cover?

The course covers C's block structure, forming grammatical statements in C using structures such as curly braces and semicolons, the comma operator, and miscellaneous syntax including keywords, identifiers, whitespace, and constants.

What lessons are included in this course?

The course includes four lessons: C's Block Structure, Forming Statements in C, The Comma Operator, and Miscellaneous Syntax.

What will I be able to do after completing this course?

You will understand block structure and how it affects variables, be able to explain how programming statements are formed in C, and recognize the various uses of the comma in C programming.

What skills does this course help develop?

This course relates to C (Programming Language), C Compilers, C Data Types, C Sharp Syntax, C-Based Programming Languages, and Syntax.

How does block structure relate to variables in C?

Blocks are groups of C statements that form a logical unit, and they control how variables are seen by different parts of a program.