Variable in C

Variable is an identifier that holds data in memory. It is used to identify input data in a program. The value of the variable can change at the time of executions. Let’s consider the syntax of a variable.

We …

Read moreVariable in C

Operators in C

An operator is a special symbol that tells the compiler to perform specific mathematical or logical operations. It is the combination of constants and variables through expressions. Example:

Where, =, +,* are operators, a,b,c are the variables and  5 …

Read moreOperators in C

Comments in C

Comments are used to comment on the line of code in the program. Comments are a way of inserting remarks and reminders into code without affecting its behavior. The compiler ignores comments, treating them as though they were whitespace. There …

Read moreComments in C

Escape Sequence in C

An escape sequence is a sequence of character that used inside the string literal or character.  All the escape sequence is used with the backslash (\) symbol. The list of an Escape sequence is as follows: Escape Sequence Meaning \a …

Read moreEscape Sequence in C

Storage Class in C

C storage class is used to define the scope variables and function. There are four various types of storage classes that are given below. auto: The auto keyword is the default storage class for all the local variables. Let us …

Read moreStorage Class in C

C Decision control statement

Decision Making C conditional statements are used to specify one or more conditions. The statements will be executed if the condition becomes true otherwise alternative statement will be executed if the condition becomes false. C language supports the following statement: …

Read moreC Decision control statement

Loop Statement in C

Loop statement is used to execute one or more statement repeatedly multiple times. There are three types of loops in C language. Why use loop? We can use loop because it executes a block of code multiple times and it …

Read moreLoop Statement in C

Break, continue and goto statement in C

Break statement Break statement is used to break the process of a loop (while, do while and for) and switch case.

Example 1

Example 2

  Continue Statement: The Continue statement is used to continue the execution …

Read moreBreak, continue and goto statement in C

Type Casting in C

Type casting is a way to convert a variable from one data type to another data type. Syntax:

Example:

Output

← Prev Next →

Function in C

Function is a group of statements that are used to perform any task. In other words, we can say that a function is a self- contained a block of programs that perform a coherent task. Why to use function A …

Read moreFunction in C

Recursion in C

Recursion is a programming technique that allows the programmer to call the function within the same function. The function which calls the same function is known as recursive function but a function that calls itself and doesn’t perform any task …

Read moreRecursion in C

String in C

String is a collection of character or group of characters. In array, string of character is terminated by a null value “\0” and enclose between double quote. We can declare string in two ways: By char array. By string literal …

Read moreString in C

C Array

An array is a collection of elements that are used to hold the fixed number of values of the same type. We cannot change the size and type of array after its declaration. Why should we use an Array? We …

Read moreC Array

Pointer in C

Pointer is a variable that is used to contain the address of another variable. We can easily create a pointer in C language. Example: int *ptr Symbol Description & (ampersand sign) Address of an operator is used to contain the …

Read morePointer in C

Dynamic memory allocation

Dynamic memory allocation is used to allocate the memory at runtime. It has following function within <stdlib.h> header file. Function Syntax malloc() malloc (number *sizeof(int)); calloc() calloc (number, sizeof(int)); realloc() realloc (pointer_name, number * sizeof(int)); free() free (pointer_name); malloc() function …

Read moreDynamic memory allocation

C –Structure

C structure is a collection of different types of data that is grouped together. It is used to represent records.Structkeyword is used to create a structure. Each element of a structure is called a member. Syntax:

Example1:

Note: …

Read moreC –Structure

Nested Structure in C

In C language, we can create nested Structure (Structure within Structure). There are two ways to define a nested structure. By separate structure By Embedded structure   Separate structure In a separate structure, we can create one or more structure …

Read moreNested Structure in C

Union in C

Union is a user-defined data type that is used to hold the different types of elements like structure. In union, all members share the same memory location. Syntax:

Example

Output

  Difference between C structure and C …

Read moreUnion in C

File Handling in C

File Handling is used to open, read, write, search and close file.  C files I/O functions handles data on secondary storage device. File handling function: There are varioushandling functions in c. Function Operation fopen() It is used to create a …

Read moreFile Handling in C

C pre-processor

The C processor is a macro processor which is used to compile the source code of the program (step by step) . It is not a part of the compiler. All pre-processor commands begin with the hash symbol (#). The …

Read moreC pre-processor