Posts

Showing posts from 2017

Client-Server Chat Appication

Image
Java Program to make a Client-Server Chat Interface In today's post, i had shared a java program to make a continuous chat interface between the Server and the Client. Note:- To run this program efficiently compile the server code first and the compile the client code.

C++ program with multiple catch

Image
CPP program to demonstrate Multiple Catch As we know, in exception handling we use the mechanism of try-catch block. In try block the statements are written which can generate the exceptions an to handle those exceptions catch block is written. But in this post there are multiple catch block to handle different kind of exceptions in the program.

Find Days and Months

Image
C program to find the number of days and months on the basis of given input In this post, I shared a C program to find the total number of months and the remaining days on the basis of the given input from the user.

C program for simple Arithmetic Operation

Image
C program to find the Addition, Subtraction, Division, Multiplication and Modulo of two numbers. In this post, I shared a code to find the simple arithmetic operation results for the given two numbers.

Implementation of Binary Search Tree in C

Image
Binary Search Tree A Binary Search Tree (BST) is a tree in which all the nodes follow the below-mentioned properties − The left sub-tree of a node has a key less than or equal to its parent node's key. The right sub-tree of a node has a key greater than to its parent node's key. Thus, BST divides all its sub-trees into two segments; the left sub-tree and the right sub-tree.

Implementation of Circular Linked List in C

Image
Circular Linked List Before going towards the circular linked list, I hope that you have the knowledge about the Doubly Linked List. If not, then click   here . Circular Linked List is little more complicated linked data structure. In the circular linked list we can insert elements anywhere in the list whereas in the array we cannot insert element anywhere in the list because it is in the contiguous memory. In the circular linked list the previous element stores the address of the next element and the last element stores the address of the starting element. The elements points to each other in a circular way which forms a circular chain. The circular linked list has a dynamic size which means the memory can be allocated when it is required.

C program to implement Double Linked List in C

Image
Doubly Linked List Before going towards the doubly linked list, I hope that you have the knowledge about the Singly Linked List. If not, then click here . Doubly Linked List is a variation of Linked list in which navigation is possible in both ways, either forward and backward easily as compared to Single Linked List. Following are the important terms to understand the concept of doubly linked list.

Implementation of Queue using Linked List in C

Image
Queue With Linked List We had seen how to implement simple queue using array. If you had not seen, just go through it once  Queue with Array Now, let us see the implementation of queue using linked list.

Implementation of Stack using Linked List in C

Image
Stack With Linked List We had seen how to implement simple stack using array. If you had not seen, just go through it once Stack with Array Now, let us see the implementation of stack using linked list.

C program to implement the Circular Queue

Image
Circular Queue with its Operation Circular Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. Graphical representation of a circular queue is as follows... Implementation of Circular Queue To implement a circular queue data structure using array, we first perform the following steps before we implement actual operations. Step 1 :  Include all the  header files  which are used in the program and define a constant  'SIZE'  with specific value. Step 2:  Declare all  user defined functions  used in circular queue implementation. Step 3:  Create a one dimensional array with above defined SIZE ( int cQueue[SIZE] ) Step 4:  Define two integer variables  'front'  and ' rear ' and initialize both with  '-1' . ( int front = -1, rear = -1 ) Step 5:  Implement...

C program to implement Stack

Image
C program to do operations on Stack using Array Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). Mainly the following three basic operations are performed in the stack: Push:  Adds an item in the stack. If the stack is full, then it is said to be an Overflow condition. Pop:  Removes an item from the stack. The items are popped in the reversed order in which they are pushed. If the stack is empty, then it is said to be an Underflow condition.

C program with the use of strlen() function.

Image
Use of strlen() Function. In this post, I had shared a program with the use of strlen() function. strlen() is a string function which gives the length of the string in form of output. Let us check the code :)

C program to count the words in a line.

Image
Count the total number of words in a line. In this post, I had shared a C program that will count the number of words in the line you had inserted. Let us observe the code :) #include <stdio.h> #include <conio.h> void main() { char s[50],ch; int i,c=0; clrscr(); printf("Enter the string: "); for(i=0;ch!='\n';i++) { ch=getchar(); s[i]=ch; } s[i]='\0'; for(i=0;s[i]!='\0';i++) { if(s[i]==' ') { c++; while(s[i]==' ') i++; } } c++; printf("\nTotal words: %d",c); getch(); } Happy Coding :)

C program to print the given numbers in Ascending Order

Image
C program to print numbers in Ascending Order In this post, i will share a C program to to print the given numbers in ascending order using simple for loop. Let us check out the code :)

C program to Add two 3X3 matrix

Image
Addition of two 3X3 matrix In this post i will share a c program with you that helps you to add 2 3X3 matrix. So lets us check out the code :)

C program to print the given number in reverse order

Image
Printing the number in Reverse Order In this post, i had shared a c program that will help you guys to print the inputted number into reverse order. For E.g. If the number is 123456789               Output will be:    987654321 Let us check out the code:

C program to implement Infix to Postfix Conversion

Image
Infix to Postfix Conversion using Stack Step-by-step procedure to convert the infix notation to postfix notation: Scan the Infix string from left to right. Initialize an empty stack. If the scanned character is an operand, add it to the Postfix string. If the scanned character is an operator and if the stack is empty push the character to stack.

C program to implement QUEUE with its operation

Image
Queue & Its Operation Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first. A real-world example of queue can be a single-lane one-way road, where the vehicle enters first, exits first. More real-world examples can be seen as queues at the ticket windows and bus-stops.

C program to implement "Call By Refrence"

Image
C program for "Call By Reference" The address of memory location  A  and  B  are passed to the function swap and the pointers  *x  and  *y  accept those values. So, now the pointer  x  and  y  points to the address of  A  and  B  respectively.

C program to implement "Call By Value"

Image
C program for "Call By Value" The  call by value  method of passing arguments to a function copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument.

Java program to find the Area of the rectangle

Image
Area Of the Rectangle

C program to print simple "Hello Friends"

Image
C program to print simple "Hello Friends" For the beginners, the C program to print "Hello Friend" is shown in the below text box with the output.

Single link-list in C

Image
C program to make a Singly Linked List Introduction to Linked list A linked list is a sequence of data structures, which are connected together via links. Linked List is a sequence of links which contains items. Each link contains a connection to another link. Linked list is the second most-used data structure after array. Following are the important terms to understand the concept of Linked List. Link  − Each link of a linked list can store a data called an element. Next  − Each link of a linked list contains a link to the next link called Next. LinkedList  − A Linked List contains the connection link to the first link called First.