Merge Sort implementation in C

Merging is the process of combining two or more sorted arrays into a third sorted array. We can use this technique to sort an array of n elements as follows. Divide the array into ā€˜n’ sub arrays of size 1 and merge adjacent pairs of sub arrays. Then we can have approximately n/2 sorted sub [...]

Continue reading →

Using Files In C Programming

This is a C program on file Handling /************** File Handling *************/ void main() { FILE *file1; char c; int choice; char op; clrscr(); do { printf(“\t\tMenu\n\t1. Enter The Information\n\t2. Display The Information\n”); scanf(“%d”,&choice); switch(choice) { case 1: printf(“\n Information \n”); file1=fopen(“Handlin.doc”,”w”); while((c=getchar())!=EOF) { putc(c,file1); } fclose(file1); break; case 2: printf(“Information\n”); printf(“Result :”); file1=fopen(“Malcolm .doc”,”r”); [...]

Continue reading →