Optimizations for bubble sort
Function


Certainly no reason to swap when values are equal.  In worse case of array {3,3,3,3}, leads to infinite loop.

//if( a[i+1] &lt;= a[i]){
if(a[i+1] &lt; a[i]) {

Use size_t to index arrays.

// void printMyArray(int a[],int n){
void printMyArray(int a[], size_t n) {



Style


Rather than int for Boolean variables use bool.

#include &lt;stdbool.h&gt;

// int swap = 0;
bool swap = false;

Recommend const when able.  Adds clarity to the function and allows for optimizations with some compilers.

// void printMyArray(int a[],int n){
void printMyArray(const int a[], int n) {

Minor: prefer int *a rather than int a[] as argument in printMyArray().
More useful to separate main() from the code under test.  Something like:

int main(void) {
    int a[] = {-1 , 2 , 0 , -3 , 5 , 1};
    bubble_sort(a, sizeof a/ sizeof a[0]);
    printMyArray(a, sizeof a/ sizeof a[0]);
    return 0;     
}

Suggest fully {} blocks.  Use Idiomatic for(), Avoid  n-1, as size_t n may be 0.

   // int i = 0;
   // for(; i &lt; n-1; i++)

   for(size_t i = 1; i &lt; n; i++) {
     if(a[i] &lt; a[i-1]) {
       int temp = a[i];
       a[i] = a[i-1];
       a[i-1] = temp;
       swap = 1;
     }
   }