Wednesday, 13 August 2014

insert number 1D

#include<stdio.h>
#include<conio.h>
int main()
    {
    int i, j,tmp;
    int limit, elm[12];
    printf("Enter the limit: ");
    scanf("%d", &limit);
    printf("Enter elements\n");
    for(i=0;i<limit;i++)
       {
scanf("%d", &elm[i]);
       }
    for(i=0;i<limit-1;i++){
for(j=i+1;j<limit;j++)
{
   if(elm[i]>elm[j])
   {
    tmp=elm[i];
    elm[i]=elm[j];
    elm[j]=tmp;
   }
}
    }
    printf("The sorted array\n");
    for(i=0;i<limit;i++){
printf("%d ", elm[i]);
   // printf("your are succusfully run ur program");
    }
    return 0;
}

1 comment:

  1. The heading is "insert number 1D "
    but it contain the programing of sorting array,
    Made correction and also mention the type of sorting technique used.

    ReplyDelete

Note: only a member of this blog may post a comment.