Launch your tech mastery with us—your coding journey starts now!
Course Content
Basic Syntax and Data Types
0/2
Arrays and Strings
0/2
Structures in C
0/1
Dynamic Memory Management
0/1
Command Line Arguments
0/1
Preprocessor Directives
0/1
C Programming

An expression is a combination of variables, constants, and operators that produces a result.

Example:

int result = (a + b) * c – d;

Operator Precedence

Priority

Operators

Associativity

1 (High)

()

Left to Right

2

++, –, – (Unary)

Right to Left

3

*, /, %

Left to Right

4

+, –

Left to Right

5

Relational

Left to Right

6

Logical

Left to Right

7

=, +=, -= etc.

Right to Left

 

Type Conversion:

Implicit Conversion: Done automatically by the compiler

int x = 10;

float y = x + 2.5;  // x is automatically converted to float

Explicit Conversion (Type Casting):

float a = 10.5;

int b = (int)a;  // Converts float to int manually