Functions in C

A function is a block of code that performs a specific task. It is a set of statements that take inputs, do some specific computation and produces output. A function can be called multiple times to provide reusability and modularity to the C program. Example : Advantage of functions in C : There are the following advantages of… Read More »

Loops in C | Set 2

Loops are very useful when you want to perform a task repeatedly. Loops are used to execute a set of statements repeatedly until a particular condition is satisfied. A loop consists of two parts, a body of a loop and a control statement. The purpose of the loop is to repeat the same code a number of times.… Read More »

Decision Making in C

C conditional statements allow you to make a decision, based upon the result of a condition. These statements are called Decision Making Statements or Conditional Statements. Decision making statements available in C are: if statement if..else statements nested if statements if-else-if ladder switch statements Jump Statements: break continue goto return 1. if statement – If a certain condition… Read More »

Storage Classes in C

Every variable in C programming has two properties: type and storage class. Type refers to the data type of a variable. And, storage class determines the scope, visibility and lifetime of a variable. Storage Classes are used to describe the features of a variable/function. These features basically include the scope, visibility and life-time which help us to trace… Read More »

Variables in C | Set 2

Prerequisite – Variables in C | Set 1 In programming, a variable is a container (storage area) to hold data. A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C has a specific type. That is, every variable declared must be assigned as a certain type of… Read More »

Operators in C

Operators are the foundation of any programming language. An operator is a symbol or a special character that tells the computer to perform certain mathematical or logical manipulations which is applied to operands to give a result. It can operate on integer and real numbers. For example, consider the below statement: c = a + b; Here, ‘+’… Read More »

Constants in C | Set 2

Prerequisite – Constants in C Constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types. Types of Constant in C : C supports several types of constants in C language as Character Constants, i.e., Single Character Constant,… Read More »

Keywords in C

A token is the smallest element of a program that is meaningful to the compiler. Tokens can be classified as follows: Keywords Identifiers Constants Strings Special Symbols Operators Keywords Keywords are already defined by Compiler that cannot be used as Variable Name, so keywords are also called as reserved words. The basic instructions are built up using a… Read More »

Identifier in C

A token is the smallest element of a program that is meaningful to the compiler. Tokens can be classified as follows: Keywords Identifiers Constants Strings Special Symbols Operators Identifiers Identifiers are names for entities in a C program, such as variables, arrays, functions, structures, unions and labels. An identifier can be composed only of uppercase, lowercase letters, underscore… Read More »

Comments in C/C++

A comment is text that the compiler ignores but that is useful for programmers. Comments are normally used to annotate code for future reference. Comments are statements that are not executed by the compiler and interpreter. The compiler treats them as white space. It makes a program more readable and error finding become easier. One important part of… Read More »