C - Expressions and Statements - onlinetutorialspoint

PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorial, we are going to learn about C Expressions and Statements.
An expression is a combination of constants and variables interconnected by one or more operators. An expression consists of one or more operands and one or more operators.
Operands are values and operators are symbols that represent particular actions.
Given below are a few examples of expressions:
num1 + num2 // variables num1 and num2 are operands and + is the operator used.
x = y // the assignment operator (=) is used to assign the value stored in y to x.
a = b + c // the value of the expression (b + c) is assigned to a.
x <= y // the lesser-than-equalTo (<=) the relational operator compares the values of x and y and returns either 1 (true) or 0 (false).
a++ // the value of variable a is incremented by 1 i.e, this expression is equivalent to a = a + 1.
Expressions can also represent logical conditions that are either true or false. In C, the conditions true and false are represented by the integer values 1 and 0 respectively.
Earlier, we learned that a program is a collection of statements.
A statement is an instruction given to the computer to perform an action.
There are three different types of statements in C:

Expression Statements
Compound Statements
Control Statements

Expression Statements
Compound Statements
Control Statements
An expression statement or simple statement consists of an expression followed by a semicolon (;).
Given below are few examples of expression statements:
a = 100;
b = 20;
c = a / b;
A compound statement also called a block, consists of several individual statements enclosed within a pair of braces { }. For example:
{
   a = 3;
   b = 10;
   c = a + b;
}
A single statement or a block of statements can be executed depending upon a condition using control statements like if, if-else, etc. We shall learn more about control statements in later sections.
Given below is an example of if control statement:
a = 10;
if ( a > 5) {
   b = a + 10;
}
Wiki – Expression
Wiki – Statement
Happy Learning 🙂

How to use Python Ternary Operator
Python Conditional Statements
Lambda Expressions in Java
C – Logical Operators
Python Operators Example
C – Arithmetic Operators
What are Lambda Expressions in Java 8
PHP if Statement Example Tutorials
C – Bitwise Operators
Difference between b++ and b=b+1
PHP Operators Example Tutorials
PHP switch Statement Example Tutorials
== Versus .equals() in Java
Python if statement Example
How do we Handle Exception in Java

How to use Python Ternary Operator
Python Conditional Statements
Lambda Expressions in Java
C – Logical Operators
Python Operators Example
C – Arithmetic Operators
What are Lambda Expressions in Java 8
PHP if Statement Example Tutorials
C – Bitwise Operators
Difference between b++ and b=b+1
PHP Operators Example Tutorials
PHP switch Statement Example Tutorials
== Versus .equals() in Java
Python if statement Example
How do we Handle Exception in Java
 


Δ
 C – Introduction
 C – Features
 C – Variables & Keywords
 C – Program Structure
 C – Comment Lines  & Tokens
 C – Number System
 C – Local and Global Variables
 C – Scope & Lifetime of Variables
 C – Data Types
 C – Integer Data Types
 C – Floating Data Types
 C – Derived, Defined Data Types
 C – Type Conversions
 C – Arithmetic Operators
 C – Bitwise Operators
 C – Logical Operators
 C –  Comma and sizeof Operators
 C – Operator Precedence and Associativity
 C – Relational Operators
 C Flow Control – if, if-else, nested if-else, if-else-if
 C – Switch Case
 C Iterative – for, while, dowhile loops
 C Unconditional – break, continue, goto statements
 C – Expressions and Statements
 C – Header Files & Preprocessor Directives
 C – One Dimensional Arrays
 C – Multi Dimensional Arrays
 C – Pointers Basics
 C – Pointers with Arrays
 C – Functions
 C – How to Pass Arrays to Functions
 C – Categories of Functions
 C – User defined Functions
 C – Formal and Actual Arguments
 C – Recursion functions
 C – Structures Part -1
 C – Structures Part -2
 C – Unions
 C – File Handling
 C – File Operations
 C – Dynamic Memory Allocation
 C Program – Fibonacci Series
 C Program – Prime or Not
 C Program – Factorial of Number
 C Program – Even or Odd
 C Program – Sum of digits till Single Digit
 C Program – Sum of digits
 C Program – Reverse of a number
 C Program – Armstrong Numbers
 C Program – Print prime Numbers
 C Program – GCD of two Numbers
 C Program – Number Palindrome or Not
 C Program – Find Largest and Smallest number in an Array
 C Program – Add elements of an Array
 C Program – Addition of Matrices
 C Program – Multiplication of Matrices
 C Program – Reverse of an Array
 C Program – Bubble Sort
 C Program – Add and Sub without using + –