
Default sign is positive.Į) Range of real constants expressed in exponential form is -3.4e38 to 3.4e38. Rules for constructing real constants expressed in exponential form:Ī) The mantissa part and the exponential part should be separated by a letter e.ī) The mantissa part may have a positive or negative sign.Ĭ) Default sign of mantissa part is positive.ĭ) The exponent must have at least one digit, which must be a positive or negative integer. Rules for constructing real constants expressed in fractional form:Ī) A real constant must have at least one digit.Ĭ) It could be either positive or negative.Į) No commas or blanks are allowed within a real constant. The real constants could be written in two forms-Fractional form and Exponential form. Real constants are often called Floating Point constants. e) The allowable range for integer constants is -32768to 32767. Rules for Constructing Integer Constants:Īn integer constant must have at least one digit.ī) It can be either positive or negative.Ĭ) If no sign precedes an integer constant it is assumed to be positive.ĭ) No commas or blanks are allowed within an integer constant. For constructing these different types of constants certain rules have been laid down. Here our only focus is on primary constant. The data types in C can be classified as follows:Ī constant is an entity that doesn’t change whereas a variable is an entity that may change.Ĭ constants can be divided into two major categories:

We can use 2 qualifiers with these basic types to get more types. Char is used to store any single character int is used to store any integer value, float is used to store any single precision floating point number & double is used to store any double precision floating point number.

There are 4 fundamental data types in C, which are- char, int, float &, double. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted. In the C programming language, data types refer to a domain of allowed values & the operations that can be performed on those values. If more than 32 are used, they will be ignored by the compiler As C is defined, up to 32 significant characters can be used and will be considered significant by most compilers.Using “INDEX” for a variable is not the same as using “index” and neither of them is the same as using “InDeX” for a variable. The case of alphabetic characters is significant.Two rules must be kept in mind when naming identifiers.

In the programming language C, an identifier is a combination of alphanumeric characters, the first being a letter of the alphabet or an underline, and the remaining being any letter of the alphabet, any numeric digit, or the underline Below figure gives a list of these keywords for your ready reference There are only 32 keywords available in C. The keywords cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword, which is not allowed by the computer. Keywords are the words whose meaning has already been explained to the C compiler. In C, various characters have been given to communicate. Ĭommunicating with a computer involves speaking the language the computer understands. Before starting with programming, we should be acquainted with the basic elements that build the language. Every language has some basic elements & grammatical rules.
