Ascending Order in C Programming Tamil


#include<stdio.h>
#include<conio.h>
void main()
{
    int a[100],i,j,n,b;
    clrscr();
    printf("\nEnter the limit : ");
    scanf("%d",&n);
    printf("\nEnter the values : ");
    for(i=0;i<n;i++)
    {
       scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)
    {
      for(j=i+1;j<n;j++)
      {
	 if(a[i]>a[j])
	 {
	    b=a[i];
	    a[i]=a[j];
	    a[j]=b;
	 }
      }
    }
    for(i=0;i<n;i++)
    printf("\n%d",a[i]);
    getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming