The perfect place for easy learning...

C Programming Language

×

Topics List

Place your ad here

C Expressions

What is an expression?

In any programming language, if we want to perform any calculation or to frame any condition etc., we use a set of symbols to perform the task. These set of symbols makes an expression.
In C programming language, an expression is defined as follows...

An expression is a collection of operators and operands that represents a specific value.

In the above definition, operator is a symbol which performs tasks like arithmetic operations, logical operations and conditional operations etc.,
Operands are the values on which the operators perform the task. Here operand can be a direct value or variable or address of memory location.

Expression Types in C

In C programming language, expressions are divided into THREE types. They are as follows...

  1. Infix Expression
  2. Postfix Expression
  3. Prefix Expression

The above classification is based on the operator position in the expression.

Infix Expression

The expression in which operator is used between operands is called as infix expression.
The infix expression has the following general structure...

Operand1 Operator Operand2

Example

Postfix Expression

The expression in which operator is used after operands is called as postfix expression.
The postfix expression has the following general structure...

Operand1 Operand2 Operator

Example

Prefix Expression

The expression in which operator is used before operands is called as prefix expression.
The prefix expression has the following general structure...

Operator Operand1 Operand2

Example


Place your ad here
Place your ad here