Assigning Variables - C Language Basics

C examples for Language Basics:Variable

Introduction

To assign a value to a declared variable. use equal sign.

The equal sign here is called the assignment operator (=).

int myInt;
myInt = 50;

The declaration and assignment can be combined into a single statement.

int myInt = 50;

To create more than one variable of the same type.

int x = 1, y = 2, z;

Related Tutorials