DEV Community

Okanu Gracious
Okanu Gracious

Posted on

1 1

Statements in Programming

What are Statements?
A statement is the smallest unit in an imperative programming language. It is formed by a sequence of one or more statement. A statement will have internal components called expression.

A definition is different from a statement in that a statement contains executable code while definitions declare an identifier.

Types of Statements
1. Simple Statements
•assignment: A:= A+1
•call: CLEARSCREEN()
•return: return 1;
•goto: goto 2
•assertion: assert(ptr != NULL);

2. Compound Statements
•block
•if-statement
•switch-statement
•while-loop
•do-loop
•for-loop

3. Assignments Statements
An assignment statement sets the value or changes the value stored in the storage locations denoted by a variable name.

Thank you for reading this article.

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay