C 1-D Array

An array is a single variable which can store multiple values at a time. Thus, C array is used to hold many values under a single name. These values can be accessed the by referring to their index number. Syntax: data_type arrayName [arraySize]; Or data_type arrayName [arraySize] = array{value 1, value 2, …}; Advantages of … Read more

Categories C

c Storage Classes

A Storage class in C represents the scope of a variable within the program. The storage classes in C are discussed below:   Storage Classes Storage Place Default Value Scope Life-time Features auto RAM Garbage Local Within function Default storage class. extern RAM 0 Global Till the end of main program Visible to all the … Read more

Categories C

Recursion in c

When a function calls itself within its function block, it is called as self calling by a function. This whole process of self calling by a function is often termed as Recursion. Recursion is used to create a loop like behavior using a function and without using loop statements. Syntax: Return_type function_Name(parameters) { code to … Read more

Categories C

C Call: Value & Reference

Call: Value & Reference: Calling a function in C and passing values to that function can be done in two ways: Call by Value Call by Reference   Call by Value Call by Reference Original value of the function parameter is not modified. Original value of the function parameter is modified. In this method, we … Read more

Categories C

C Functions

A function is a piece of code that can be used repeatedly in a C program. A function is mainly of two types: Built in Functions; which are already defined in C Library. User Defined Functions; which are created and defined by users.   Syntax: Return_type functionName(parameters) {     code to be executed; }   … Read more

Categories C

Type Casting in c

Type casting in C simply means to convert one data type into other. C facilitates with a special operator named (type) which serves the purpose of type casting, where type represents the required data type. Syntax: (type) value; Example: #include<stdio.h> void main() { char value= (char)66; printf("Value : %c\n", value ); }#include<stdio.h> void main() { … Read more

Categories C

C Goto

C goto statement is used to jump to a specified label in the code every time, without any condition. Syntax: loop/conditions statements { statements; goto; } Example: #include <stdio.h>   void main() { int i,n; printf ("Enter a number: "); scanf ("%d",&n);   less: printf ("less than 5");   if (i < 5) goto less; … Read more

Categories C

C continue

C Continue statement is used to skip the execution of current iteration in between the loop. Continue statement controls the containing loop only, i.e, external loops will not get affected because of Continue statement in inner loop. Syntax: loop/conditions statements { statements; continue; } Example: #include <stdio.h>   void main() { int i,j;   for … Read more

Categories C

C break

C break statement is used to break the execution of current loop in between the loop or to prevent the code to check the next switch case. Break statement breaks the continuity of the containing loop only, i.e, external loops will not get affected because of Break statement in inner loop. Syntax: loop/conditions statements { … Read more

Categories C

C for loop

C For Loop is a loop statement which can be used in various forms to execute a block of code continuously as long as the condition of the loop is true, and stops only when the condition fails. These are: For Loop : For loop is used to execute a group of action only for … Read more

Categories C