Compound Statement in C Programming

Compound Statements

A compound statement (also called a "block") typically appears as the body of another statement, such as the if statement, for statement, while statement, etc

A Compound statement consists of several individual statements enclosed within a pair of braces { }. The individual statements may themselves be expression statements, compound statements or control statements. Unlike expression statements, a compound statement does not end with a semicolon. A typical Compound statement is given below.

{

pi=3.14;

area=pi*radius*radius;

}

The particular compound statement consists of two assignment-type expression statements.

Example:

Ready to get started?

Ready to embark on your journey into the world of C programming? Our comprehensive course provides the perfect starting point for learners of all levels. With engaging lessons, hands-on exercises, and expert guidance, you'll gain the skills and confidence needed to excel in this fundamental programming language. Let's dive in and unlock the endless possibilities of C programming together!