please tell me why i am not getting output.This program is of bubble sort

#include<stdio.h>
void swap(int *a,int *b)
{
int con;
con=*a;
*a=*b;
*b=con;
}
void main()
{
int n,l,i,cnt;
printf(“enter the value of n\n”);
scanf(" %d", &n);

    int a[n],j;
    printf("enter the element\n");
    for(i=0;i<n;i++)
        scanf(" %d", &a[i]);
        n=l;
  for(j=0;j<n-1;j++)
    {

     for(i=0;i<n-j-1;i++)
        {
            if(a[i]>a[i+1])
            {
                swap(&a[i],&a[i+1]);

            }
        }

    }
    for(i=0;i<l;i++)
        printf("%d ",a[i]);

}

Try changing limits of both loops to N. I feel you have an issue with limit of inner loop.

not getting output then also

I ran your code and error seems to be simple. There are two errors according to an Online Judge:

  1. Output error(personal error): This can be dealt with by simply assigning l = n after input of n. You can also replace l by n since n is non-changing and l is not required.

  2. Runtime error: This is due to using void main. Since there is no return value to judge, it shows runtime error.