Saturday, November 11, 2006

Collation

Collation is the assembly of written information into a standard order. In common usage, this is called alphabetisation, though collation is not limited to ordering letters of the alphabet. Collating lists of words or names into alphabetical order is the basis of most office filing systems, library catalogs and reference books.
Here I write a sorting algorithm, flowchart and source code in C Language.

Title: Arrange N names in Ascending Alphabetical Order.
1. Algorithm
Step1: start.
Step2: Declare variables, 2 arrays of character type (tmp[10],name[20][10]) and 2 integer type variables (I,n).
Step3: Read n and read names from the user.
Step4: print the list as it was entered.
Step5: for loop starting from I = 1 to I <> name[i+1] then
Swap name[i] and name[i+1]
End-if
End-for
Step6: print names sorted in ascending order.
Step7: stop.
2. Flowchart.

3.Source Code in C Language.

/*

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#

#Author:Abdulla Mustafa. #

#Date-Written:26/3/2003. #

#Date-Compile:26/3/2003. #

#Date-Updated:05/2/2005. #

#Security:public domain. #

#Source-Computer:PC. #

#Object-Computer:PC. #

#Source-Compiler:Turbo C. #

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#

*/

#include<stdio.h>

#include<conio.h>

#include<string.h>

main()

{

char tmp[10],name[20][10];

int i,n;

clrscr();

printf("Enter Number of names:");

scanf("%d",&n);

for(i=0;i<n;i++)

{

printf("Enter name %d\n",i+1);

scanf("%s",&name[i]);

}

printf("\nName list before Sorting");

for(i=0;i<n;i++)

{

printf("\n%s",name[i]);

}

for(i=0;i<n-1;i++)

{

if((strcmp(name[i],name[i+1])>1))

{

strcpy(tmp,name[i]);

strcpy(name[i],name[i+1]);

strcpy(name[i+1],tmp);

}

}

printf("\nAscending Order\n...........");

for(i=0;i<n;i++)

printf("\n%s",name[i]);

getch();



}


4.input output
Enter Number of Names:3
enter name 1
mohamed
enter name 2
aisha
enter name 3
ali
Name list before sorting
mohamed
aisha
ali
Name list in asceding order
--------------------------
aisha
ali
mohamed

Tuesday, November 07, 2006

Welcome

Hello every one,

I am Abdulla Musthafa(mustho), Maldivian National Studying at bangalore University, Bangalore, Major:Computer Applications.
This blog will be about computer software development activites like coding in various high level and low level languages, debuging, etc..
Some of the Computer Languages, I am familiar with are given below:

1. Assembly Language Programming(ALP of Intel 8085).

2.Common Business Oriented Language(COBOL-85).

3.PASCAL Programming Language.

4.C Programming Language.

5.C++ Programming Language.

6.C# Programming Language.

7.Java Programming Language.

8.Perl Programming Language.

9.Visual Basic.NET.

10.PHP Programming Language.

thank you for taking your time to visit this blog.

Abdulla Musthaf,
House No:35,
15th KM,
Old Madaras Road,
Virgonagar,
Bangalore-49,
Karnataka,
India,
Tel: +91-9880826751
Email: abdullamustafa@hotmail.com