C

Comments in C language

Comments in C language

Comments are merely program documentation which helps the reader to understand the code. The compiler ignores these comments when it translates the program into executable code. C language uses two different formats of comment 1. Block comment 2. Line comment 1. Block comment: A block comment is used when the comment will span several lines. […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

General Structure of C program

General Structure of C program

Basic Structure of a C program contains following sections, Documentation Section Link Section Definition Section Global Declaration Section main() { Declaration Section Executable part } Subprogram section Function 1 Function 2 . . function n The Documentation Section consists of a set of comment lines giving the name of the program and other details. The […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Binary Search

Binary Search

A binarysearch program locates the position of an item in a sorted array. Logic: The Binary search starts by testing the element at the middle of the array. Let us consider an array ‘a’ with all elements arranged in ascending order. Let low and high are the lower and upper indices of the array ‘a’, respectively. We want to search an item […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Insertion sort in C program

Insertion sort in C program

Here is the program to sort the given integer in ascending order using insertion sort method. Please find the pictorial tutor of the insertion sorting. Logic : Here, sorting takes place by inserting a particular element at the appropriate position, that’s why the name-  insertion sorting. In the First iteration, second element A[1] is compared […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Bubble sort program in C

Bubble sort Image Demo

Here is the program to sort the given integer in ascending order using bubble sort method. Please find the pictorial tutor of the bubble sorting. Logic :  The entered integers are stored in the array A. Here, to sort the data in ascending order, any number is compared with the next numbers for orderliness. i.e. […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Mouse programming in C

Mouse programming in C

Mouse can be used in text mode as well as in graphics mode. Usually it is used in graphics mode. Hence we must first change over to graphics mode. In our program the function initgraph() is responsible for switching the mode from text to graphics .DETECT is a macro defined in ‘graphics.h’. It requests initgraph() […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Turbo C graphics programming

Turbo C graphics programming

To start with graphics programming, Turbo C is a good choice. Even though DOS has its own limitations,  it is having a large number of  useful functions and is easy to program. To implement graphics algorithms,  To give graphical display of statistics, To view signals from any source, we can use C graphics. Here  is  […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Sorting of numbers

Sorting of numbers

Sorting means arranging a set of data in some order. There are different methods that are used to sort the data in ascending order. Some of the  methods are Selection sort Bubble sort Insertion sort 1. Selection sort Here, to sort the data in ascending order, the 0th element is compared with all other elements. […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone