pyramid numbers in alternative reverse order
Naming    


int n=5; // no of rows  



If you need a comment to explain the intent of an variable, then something went wrong. You should just rename the variable to numberOfRows.
Also variable names which aren't loop iteration variables shouldn't have single letter names.
E.g c should better be currentNumber.

Space 


for(int i=1;i&lt;=n;i++){  



Help you code to breath and add some space

for(int i = 1; i &lt;= n; i++){  


is easier to read.  

Indention  


    if(i%2!=0){
    for(int j=0;j&lt;i;j++){
        c++;
        System.out.print(c +" ");
    }
    }



wouldn't the above be easier to read if coded like

    if(i%2 != 0){
        for(int j = 0; j &lt; i; j++){
            c++;
            System.out.print(c +" ");
        }
    }