C Programming Fundamentals: Keywords, Identifiers, Variables, and Data Types, Schemes and Mind Maps of Computer science

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

2025/2026

Available from 09/17/2025

vrushabh-lokhande
vrushabh-lokhande 🇮🇳

7 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Keywords:
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
Identifiers:
Identifier refers to name given to entities such as variables, functions, structures etc.
Also remember, identifier names must be different from keywords.
Rules for naming identifiers
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.
pf3

Partial preview of the text

Download C Programming Fundamentals: Keywords, Identifiers, Variables, and Data Types and more Schemes and Mind Maps Computer science in PDF only on Docsity!

Keywords:

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

Identifiers:

Identifier refers to name given to entities such as variables, functions, structures etc. Also remember, identifier names must be different from keywords.

Rules for naming identifiers

 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.

Variables

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

Constants

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;

Data-types:

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