C

Literals in C

Literals in C

Constant values used within a program are known as Literals. These constant values occupy memory but do not have any reference like variables. There are four types of literals in C Integer literal Float literal String literal Character literal Integer literal Integer literals are used to represent and store the integer values. Integer literal is followed …

Literals in C Read More »

Operators in C

Operators in C

An operator is a symbol that helps us to perform specific mathematical and logical computation operation on a value or a variable. There are following types of operators to perform different types of operations in C language. Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Other Operators Arithmetic Operator An arithmetic operator performs …

Operators in C Read More »

Identifiers in C

Identifiers in C

Identifier refers to name given to different entities such as constants, variables, structures, functions, etc. Example int age; double mobile_number; Here age and mobile_number are identifier. int and double are data type. Rules for naming Identifier We cannot use keywords as identifier. The first letter of an identifier should be either a letter or an …

Identifiers in C Read More »

Storage Classes in C

Storage Classes in C

Storage class determines the scope, visibility, memory location, default value and lifetime of a variable or function. A storage class in C is used to describe the following things. Variable’s scope. Location where the variable will be stored. Initialized value of a variable. Lifetime of a variable. Who can access a variable? There are four …

Storage Classes in C Read More »

Keywords in C

Keywords in C

Keywords are predefined, reserved words used in programming that have special meanings to the compiler. It helps us to use the functionality of C language. We cannot use it as a variable name, constant name, etc. There are 32 reserved keywords in the C language. ** All keywords must be written in lowercase. Table of 32 …

Keywords in C Read More »

Constants in C

Constants in C

A constant is a variable whose value cannot be changed after its definition. Constants in C are the fixed values and its value remains unchanged during the entire execution of the program. Generally, we use const keyword to create a constant. There are two Ways in C to define constants Using const keyword. Using #define preprocessor. Constants are also …

Constants in C Read More »

Variables in C

Variables in C

Variable is a storage place to hold data which has some memory allocated to it. It is used to store data.  it can be reused many times. We can change value of a variable during execution of a program. Different types of variables require different amounts of memory. C is a strongly typed language. This …

Variables in C Read More »

Data Types in C

Data Types in C

Data types are declarations for variables. It specifies the type and size of data that a variable can store. Each data type requires different amounts of memory and has some specific operations which can be performed over it. There are the following data types in C Basic Data Type Derived Data Type Enumeration Data Type …

Data Types in C Read More »

Comments in C

Comments in C

Comments are ignored by the compiler. We write comments to provide information and better understanding of the program or about lines of code. There are two ways in which we can write comments in C program Using //:- This is used to write a single-line comment. 2. Using /* */:- The statements enclosed within /* …

Comments in C Read More »

Basic Syntax Rules in C

Basic Syntax Rules in C

A smallest individual unit in C program is known as C Token. Tokens are either keywords, identifier, constants, Variables, string literal or any symbol which has some meaning in C language. A C program can also be called as a collection of various tokens. i.e:- printf(“Hello, World! \n”); consists of five tokens 1- printf, 2- …

Basic Syntax Rules in C Read More »

Scroll to Top