Friday, 16 September 2011

C_to_ascend_n_numbers



#include <stdio.h>
main()
{
int n,i,j,a[10][10],t;
clrscr();
printf("enter the limit of an array\n");
scanf("%d",&n);
printf("enter the elments of an array\n");
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
for(j=1;j<=n-i;j++)
scanf("%d",&[j+1])
{
t=a[j];
a[j]=a[j+1]=t;
}
printf("the numbers after sorting are:\n");
for(i=1;i<=n;i++)
printf("%d\t",a[i]);
getch();
}

0 comments:

Post a comment