
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

2K+ Views
C programming language provides two types of searching techniques. They are as follows − Linear search Binary search Binary Search This method can be applied only to sorted list. The given list is divided into two equal parts. The given key is compared with the middle element of the list. Here, three situations may occur, which are as follows − If the middle element matches the key, then the search will end successfully here ... Read More

3K+ Views
ProblemWrite a program to replace all zeros (0's) with 1 in a given integer.Given an integer as an input, all the 0's in the number has to be replaced with 1.SolutionConsider an example given below −Here, the input is 102410 and the output is 112411.AlgorithmRefer an algorithm given below to replace all the 0’s to 1 in an integer.Step 1 − Input the integer from the user.Step 2 − Traverse the integer digit by digit.Step 3 − If a '0' is encountered, replace it by '1'.Step 4 − Print the integer.ExampleGiven below is the C program to replace all 0's ... Read More

5K+ Views
A local static variable is a variable, whose lifetime doesn’t end with the function call in which it is declared. It extends until the entire programs lifetime. All function calls share the same copy of local static variables. Static Variables A static variable preserves its value across multiple function calls, maintaining its previous value within the scope where it was initialized. These variables are used to count the number of times a function is called. The default value of a static variable is 0. In contrast, normal local scope means that the variables defined within the block are only visible ... Read More

782 Views
In C programming language, the most common use of structure is an array of structures.To declare an array of structures, first the structure must be defined and then, an array variable of that type has to be defined.For example,struct book b[10];//10 elements in an array of structures of type ‘book’ExampleFollowing is the C program for the array of structures − Live Demostruct marks{ int sub1; int sub2; int sub3; int total; }; main(){ int i; struct marks student[3] = {{20,17,11,10}, {175,23,169,10}, {27,56,27,01}}; struct marks total; for(i = 0; i

9K+ Views
In C programming language, a structure is a collection of different datatype variables, which are grouped together under a single name.Declaration and initialization of structuresThe general form of a structure declaration is as follows −datatype member1; struct tagname{ datatype member2; datatype member n; };Here, struct is a keyword.tagname specifies the name of structure.member1, member2 specifies the data items that make up structure.For example, struct book{ int pages; char author [30]; float price; };Structure variablesThere are three methods of declaring structure variables, which are as follows −First methodstruct book{ int pages; char author[30]; ... Read More

1K+ Views
Searching for an algorithm is considered as a step-by-step procedure for specifying a data among a large set of data. The C programming language provides two types of searching techniques. They are as follows − Linear search Binary search Linear Search A Linear Search is also known as sequential search, which is a process for finding an item in a list of items. This kind of algorithm checks each element of the list one by one until a match is found in the total list . ... Read More

1K+ Views
Queue overflow and Queue under flow can be avoided by using linked list.Operations carried out under queue with the help of linked lists in C programming language are as follows −InsertDeleteInsertionThe syntax is as follows −Syntax&item : Newnode = (node*) mallac (sizeof (node)); newnode ->data = item; newnode ->link = NULL; if ((front = = NULL) || (rear = = NULL)){ front= newnode; rear = newnode; }else{ Rear->link = newnode; rear = newnode; }DeletionThe syntax is as follows −Syntaxif ((front= = NULL)) printf("Deletion is not possible, Queue is empty"); else{ temp = front; front ... Read More

3K+ Views
Stack over flow and stack under flow can be avoided by allocating memory dynamically.Operations carried out under stack in C programming language are as follows −PushPopPushFollowing is the basic implementation of a linked list −&item = 10 newnode = (node*) malloc (sizeof (node)); newnode ->data = item; newnode ->link = NULL; newnode ->link = start; start = newnode;popThe syntax is as follows −Syntaxif (start = = NULL) printf("Deletion is not possible.List is empty") else{ temp = start; start = start link; free (temp); }ProgramFollowing is the C program for stack by using linked lists −#include #include ... Read More

717 Views
Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. They are defined as a collection of nodes. Here, nodes have two parts, which are data and link. The representation of data, link and linked lists is given below −Operations on linked listsThere are three types of operations on linked lists in C language, which are as follows −InsertionDeletionTraversingDeletionConsider an example given below −Delete node 2Delete node 1Delete node 3ProgramFollowing is the C program for deletion of the elements in linked lists − Live Demo#include #include struct Node{ int data; struct Node *next; }; void ... Read More

7K+ Views
Data structure is collection of data organized in a structured way. It is divided into two types as explained below −Linear data structure − Data is organized in a linear fashion. For example, arrays, structures, stacks, queues, linked lists.Nonlinear data structure − Data is organized in a hierarchical way. For example, Trees, graphs, sets, tables. Also Read: Data Structures and Types Queue Queue is a linear data structure, where the insertion is done at rear end and the deletion is done at the front end.The order of queue is FIFO – First In First OutOperationsInsert – Inserting an element into ... Read More