What is wrong with the following program?
I am unable to understand why the program doesnt compile?
[insert]
Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc , char * argv[])
{
int n, i, j;
//int []a;
//n = atoi(argv[1]);
int a[10];
for(i = 0;i<10;i++)
{
int temp = random(10);
printf("\n%d", temp);
a[i] = temp;
}
for(i = 0; i<10 ; i++){
for(j = 0; j<10 ;j++){
if(a[j] > a[j+1]){
int t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
}
}
printf("\n Array in ascending order");
for(i = 0; i< 10;i++){
printf("\n %d", a[i]);
}
return 0;
}