hi
could u plz help me out with this array problem...in which i have to print "array elements in ascending order"....while compilation there is no error but when i run the code it shows the output as -- 24768, which is very weird. i have wriiten the code like this:::
#include<stdio.h>
#include<conio.h>
int main(void)
{
int a[10],temp,i,j;
clrscr();
printf("ENTER ARRAY ELELMENTS:");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
fflush(stdin);
for(i=0;i<10;i++)
{
for(j=j+1;j<10;j++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
printf("SORTED ARRAY IS:");
fflush(stdout);
for(i=0;i<10;i++)
printf("%d",a[i]);
fflush(stdout);
getch();
return 0;
}