

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A concise overview of fundamental concepts in c programming, including keywords, identifiers, variables, constants, and data types. It explains the rules for naming identifiers, the purpose of variables and constants, and the different types of data available in c. The document also includes a code snippet demonstrating the use of the sizeof() operator to determine the size of various data types. This is useful for high school students learning the basics of c programming.
Typology: Schemes and Mind Maps
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Keywords are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are part of the syntax and they cannot be used as an identifier. As C is a case sensitive language, all keywords must be written in lowercase. C Keywords auto double int struct break else long switch case enum register typedef char extern return union continue for signed void do if static while default goto sizeof volatile const float short unsigned
Identifier refers to name given to entities such as variables, functions, structures etc. Also remember, identifier names must be different from keywords.
A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores. The first letter of an identifier should be either a letter or an underscore. You cannot use keywords like int, while etc. as identifiers. There is no rule on how long an identifier can be. However, you may run into problems in some compilers if the identifier is longer than 31 characters.
A variable is a container to hold data. To indicate the storage area, each variable should be given a unique name. the variable type cannot be changed once it is declared. For example: int number = 5; // integer variable number = 5.5; // error double number; // error
If you want to define a variable whose value cannot be changed, you can use the const keyword. This will create a constant. For example, const double PI = 3.14;
A data type specifies the type of data that a variable can store such as integer, floating, character, etc. Data types are declarations for variables. This determines the type and size of data associated with variables. Types of data types in C language. Types Data Types Basic Data Type Int(%d), char(%c), float(%f), double(%lf) Derived Data Type array, pointer, structure, union Enumeration Data Type enum Void Data Type void