Recent Articles
- How to Capture error log using C#.Net?, Started by sameer_havakajoka in C#
- Generate and add keyword variations on Google AdWords from .NET, Started by JosipK in C#
- Read and write ODF/ODS files (OpenDocument Spreadsheets), Started by filip in C#
- Send Email and attachments in C#, Started by naimish in C#
- Simple Encryption/Decryption using C#, Started by naimish in C#
Similar Articles
- 100 Multiple choice questions in C, Started by coderzone in C-C++
- Overview of C#, Started by Sanskruti in C#
- Data Types in C#, Started by pradeep in C#
Code: CSharp
/*
** Simple class to sort an array in ascending order using bubble sort
** @author: Tanaz Kerawala
** @author: S Pradeep
** @date: 5/29/2007
*/
using System;
class AscendingBubbleSort
{
public static void Main()
{
int i,j,t;
int []p=new int[10];
int []q=new int[10];
int []c=new int[20];
for(i=0;i<10;i++)
{
Console.WriteLine("Enter Value");
p[i]=int.Parse(Console.ReadLine());
}
for(i=0;i<10;i++)
{
Console.WriteLine("Enter Value");
q[i]=int.Parse(Console.ReadLine());
}
if(j<10)
c[j]=p[j];
else
c[j]=q[j-10];
// Sorting: Bubble Sort
for(i=0;i<20;i++)
{
for(j=0;j<20;j++)
{
if(c[i]>c[j])
{
t=c[i];
c[i]=c[j];
c[j]=t;
}
}
}
// Print the contents of the sorted array
for(i=0;i<20;i++)
{
Console.WriteLine (c[i]);
}
}
}











Yet to provide details about himself


Yours truely, Sushovan Mukherjee



Linear Mode

