C variable, Data Types and Format Specifiers

What is C variable ?

A variable is the name of a reserved area allocated in memory. It is a container which holds the value while the Java program is executed. A variable is assigned with a data type.

Data Types in C can be classified as – (1) Primitive Data Types, (2) User Defined Data Types And (3) Derived Types

1) Primitive Data Types – int, float, char, double, void

2) User Defined Data Types – function, array, pointer, reference

3) Derived Types – class, structure, union, enum, typedef

Format Specifiers

There are different format specifiers for each data type. Here are some of them – int (%d, %i), float (%f, %F), double (%lf), long double (%Lf), char (%c), string (%s)

Leave a Comment

Your email address will not be published. Required fields are marked *